Skip to content

Instantly share code, notes, and snippets.

View feryardiant's full-sized avatar
🎯
Focusing

Fery Wardiyanto feryardiant

🎯
Focusing
View GitHub Profile
<?php
$colors = array();
for ($i = 0; $i <= 256; $i++) {
$colors[] = $i;
}
?>
@feryardiant
feryardiant / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@feryardiant
feryardiant / README.md
Last active August 29, 2015 14:23
Array Order by

Example Usage

$data = [
  [ 'parent'=> 1, 'id' => 4, 'data' => 'empat', ], 
  [ 'parent'=> 4, 'id' => 2, 'data' => 'dua',   ], 
  [ 'parent'=> 0, 'id' => 3, 'data' => 'tiga'   ], 
  [ 'parent'=> 3, 'id' => 1, 'data' => 'satu'   ]
];
@feryardiant
feryardiant / boxblurcanvas.js
Created April 8, 2012 03:58 — forked from yorickvP/boxblurcanvas.js
Fast canvas box blur
/*
BoxBlur - a fast almost Box Blur For Canvas
Edited by Yorick to make it faster in modern browsers
Version: 0.3
Author: Mario Klingemann
Contact: mario@quasimondo.com
Website: http://www.quasimondo.com/
<?php # -*- coding: utf-8 -*-
/**
* Create a nav menu with very basic markup.
*
* @author Thomas Scholz http://toscho.de
* @version 1.0
*/
class T5_Nav_Menu_Walker_Simple extends Walker_Nav_Menu
{
/**
@feryardiant
feryardiant / README.md
Last active January 21, 2016 14:33
Thue Morse Sequence - PHP Implementation

Thue Morse Sequence - PHP Implementation

Recently, I got a job vacancy test and this is the one of questions i've got. I'm absolutely new here so CMIIW 😉

Usage

Simply download the gist and create new file called whatever.php then copy-paste lines below:

!#/usr/bin/env php
@feryardiant
feryardiant / Lumen_Slim2_Slim3_Panada_Ci3.md
Last active July 29, 2016 17:17
Just try to bench using AB, Lumen vs Slim 2.x vs Slim 3.dev vs Panada vs Codeigniter 3.x

Benchmarks tldr;

OS: Ubuntu 14.04 64bit
Server Hostname: localhost
Server Software: PHP 5.5.23 Build-in server
Benchmark command: ab -t 60 -c 5

Bench Lumen Slim 2.x Slim 3.x Silex Panada CI 3
Document Path / / / / / /
@feryardiant
feryardiant / install_nvm.sh
Last active October 8, 2016 22:23
Install NVM
#!/usr/bin/env sh
[ -d ~/.nvm ] && rm -rf ~/.nvm
git clone -q https://github.com/creationix/nvm.git ~/.nvm
cd ~/.nvm && git checkout -q `git describe --abbrev=0 --tags`
@feryardiant
feryardiant / vagrant-vbga-update
Last active October 31, 2016 02:27 — forked from zbal/gist:7800423
Update VBox Guest Additions on Ubuntu Guest (Vagrant)
# Start the old vagrant
vagrant@host:~$ sudo su
root@host:/home/vagrant# sudo wget -c http://download.virtualbox.org/virtualbox/4.3.10/VBoxGuestAdditions_4.3.10.iso -O VBoxGuestAdditions_4.3.10.iso
root@host:/home/vagrant# mount VBoxGuestAdditions_4.3.10.iso -o loop /mnt
mount: block device /home/vagrant/VBoxGuestAdditions_4.3.10.iso is write-protected, mounting read-only
root@host:/home/vagrant# cd /mnt
root@host:/mnt# sh VBoxLinuxAdditions.run --nox11
root@host:/mnt# cd ~
root@host:/mnt# VBoxGuestAdditions_4.3.10.iso
root@host:/mnt# ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
@feryardiant
feryardiant / twbs_comment_form_defaults.php
Created October 24, 2017 17:04
Twitter Bootstrap Comment Form for Wordpress
<?php
if ( ! function_exists( 'twbs_comment_form_defaults' ) ) {
/**
* Customize default wp comment form.
*
* @link https://developer.wordpress.org/reference/hooks/comment_form_defaults/
* @link https://codex.wordpress.org/Function_Reference/comment_form
*
* @param array $defaults