Skip to content

Instantly share code, notes, and snippets.

View wzulfikar's full-sized avatar
💭
Set status

Wildan Zulfikar wzulfikar

💭
Set status
View GitHub Profile
@wzulfikar
wzulfikar / dt_editor.sql
Last active November 19, 2016 18:02
MySQL dump for Datatables Editor examples (https://editor.datatables.net/examples/index). Example for other DB: https://editor.datatables.net/manual/php/installing
--
--
-- MySQL tables used to run the Editor examples.
--
-- For more information about how the client and server-sides interact, please
-- refer to the Editor documentation: http://editor.datatables.net/manual .
--
--
@wzulfikar
wzulfikar / indonesia.sql
Last active November 29, 2016 16:55
Indonesia: provinces, districts, regencies, villages. Forked from github.com/edwardsamuel/Wilayah-Administratif-Indonesia
This file has been truncated, but you can view the full file.
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
@wzulfikar
wzulfikar / Install composer on Amazon AMI running on EC2
Last active December 27, 2016 14:26 — forked from asugai/Install composer on Amazon AMI running on EC2
Install composer on Amazon AMI running on EC2
cd ~
sudo curl -sS https://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
sudo ln -s /usr/local/bin/composer /usr/bin/composer
composer --version
@wzulfikar
wzulfikar / GetFbProfile.php
Created February 19, 2017 12:18
Get FB User Profile
<?php
/**
* fetch profile of given fb's user id. fields are optional.
*/
function getFbProfile($userId, array $fields = [])
{
$ACCESSS_TOKEN = 'YOUR_TOKEN_HERE';
$BASE_URL = 'https://graph.facebook.com/v2.6';
// fetch default fields if no fields passed
@wzulfikar
wzulfikar / orderSummary.ts
Created November 14, 2017 18:08
Using TypeScript to create order summary.
/**
* Wed, 15 Nov 2017 at 0:56:13 MYT
* "Using TypeScript to create order summary."
*
* The purpose of this snippet is to demonstrate the
* use of TypeScript in our code.
* You can run this code online here:
* https://www.typescriptlang.org/play/
*
* PS:
@wzulfikar
wzulfikar / par-demo.scala
Created November 19, 2017 04:25
Using parallel function and thread in Scala.
/**
* Using parallel function and thread in Scala.
*
* Run in scastie: https://scastie.scala-lang.org
*
*/
// Higher-order function that displays
// time elapsed to execute any given function
def timer (taskId : String, f: () => Unit) = {
@wzulfikar
wzulfikar / iStat Menus Settings.ismp
Created September 20, 2016 09:59
My preferred settings for iStat Menus (https://bjango.com/mac/istatmenus/)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>build</key>
<real>681</real>
<key>license</key>
<string>7765-5449-1074-5985-8835</string>
<key>preferences</key>
<dict>
@wzulfikar
wzulfikar / shamir-demo.js
Created October 23, 2018 08:22
shamir secret sharing demo in js
const secrets = require('secrets.js-grempe')
const shamir = {
create: (plainText, totalShares, threshold) => {
// convert the text into a hex string
var pwHex = secrets.str2hex(passphrase); // => hex string
// split into 2 shares with a threshold of 2.
// 1 share will be sent to backend and stored there
// and another share will be kept by the user.
@wzulfikar
wzulfikar / summernote-upload-image.js
Created December 4, 2015 13:45
attaching image in summernote editor (ajax)
<script>
/**
* Super simple WYSIWYG editor using Bootstrap.
* https://github.com/summernote/summernote
*/
$(document).ready(function() {
// init summernote with height: 200px
$('.summernote').summernote({
height: 200,

Keybase proof

I hereby claim:

  • I am wzulfikar on github.

  • I am wzulfikar (https://keybase.io/wzulfikar) on keybase.

  • I have a public key ASDwimH7OPEvqzHFVBGnJe6lWpzCz_sskDdNkffx8G1JBwo