Skip to content

Instantly share code, notes, and snippets.

View chez14's full-sized avatar

Chris Qiang chez14

View GitHub Profile
@chez14
chez14 / hardian.js
Last active October 13, 2015 11:49
memudahkan menstruktur template.
/*
Hardian.js
Memudahkan kami untuk mestruktur template.
*/
var nav = {
pengaturan: {
waktuTransisi: 500
},
init: function(){
var aku = this;
@chez14
chez14 / Fernando.html
Last active April 16, 2016 12:57
Latihan pake Modal sama Form inputnya Bootstrap~
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.3.min.js" type="text/javascript"/></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jQuery-slimScroll/1.3.7/jquery.slimscroll.js" type="text/javascript"></script>
<title>Tes~</title>
</head>
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.3.min.js" type="text/javascript"/></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jQuery-slimScroll/1.3.7/jquery.slimscroll.js" type="text/javascript"></script>
<title>Tes~</title>
</head>
<?php
$array = array (
'foo',
'bar',
'baz'
);
$hasil = array();
$count = count($array);
for ($i = 0; $i < $count; $i++)
$hasil=[$array[$count-$i-1]=>$hasil];
@chez14
chez14 / EasyBitString.java
Created May 21, 2017 14:15
BitString? No Problem
public class EasyBitString {
/**
* Generate BitString secara brutal
* Well, best option kalo cara yang dari modul nggak inget sama sekali.
*
* Cara:
* Buat komputer menghitung 1 hingga angka tertentu, lalu kita conver angka
* tersebut jadi bitstring. Kita dapat menggunakan kelas Integer untuk
* melakukan hal serupa.
@chez14
chez14 / encrypt_openssl.txt
Created June 4, 2017 15:04 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL
For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
For Asymmetric encryption you must first generate your private key and extract the public key.
@chez14
chez14 / Kambing.java
Created August 17, 2017 12:53
Mana yang paling cepat?
public class Kambing {
public static void main(String[] args){
int[] hive = {1,2,3,4,5,6,7,8,9,0};
int needle = 8;
/*
Ada 3 buah method yang bisa digunakan, dan sama-sama jalan semua.
tapi mana yang lebih cepet dari 3-3nya ini?
@chez14
chez14 / Pool.java
Last active October 18, 2017 11:41
GANTENG
import java.util.Random;
public class Pool
{
public static boolean validity(int min, int max){
Random rd = new Random();
int lottery1 = rd.nextInt(max-min)+min;
int lottery2 = rd.nextInt(max-min)+min;
int lottery3 = rd.nextInt(max-min)+min;
System.out.println(lottery1);
System.out.println(lottery2);

ES2K15 this

const benda = {
    a: function() {
        this.v_a = 1;

        let x = {
            count_va: () =>{ // notice here, we're using () => {...}
 return this.v_a;
@chez14
chez14 / Test.java
Last active March 31, 2018 06:02
Testing Thread
public class Test {
public void test() {
Thread saver = new Thread(() -> {
try {
td.save(location);
} catch (IOException ex) {
Logger.getLogger(frmMain.class.getName())
.log(Level.SEVERE, null, ex);
}
});