Skip to content

Instantly share code, notes, and snippets.

View feryardiant's full-sized avatar
🎯
Focusing

Fery Wardiyanto feryardiant

🎯
Focusing
View GitHub Profile
@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: [email protected]
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 / custom_posttype_glance.php
Created April 26, 2014 13:42
Adding Custom post type counts in 'Right now' Dashboard widget in Wordpress 3.8 or above
<?php
/**
* Adding Custom post type counts in 'Right now' Dashboard widget.
* Acording this changes :
* - https://core.trac.wordpress.org/ticket/26571
* - https://core.trac.wordpress.org/ticket/26495
* now you can't use 'right_now_*' action API to show your custom post type count from your Dashboard.
* But if you running WP 3.8 or above, you can use 'dashboard_glance_items' instead.
*
* @package Wordpress
<?php
$colors = array();
for ($i = 0; $i <= 256; $i++) {
$colors[] = $i;
}
?>
@feryardiant
feryardiant / dmg2img.md
Created July 29, 2014 00:36
Create bootable USB from .DMG image file in Linux

Create bootable USB from .DMG image file in Linux

Courtesy: [email protected]

Install dmg2img

$ sudo apt-get install dmg2img
@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 / 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 / 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 / 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 / install_libsass.sh
Last active June 26, 2021 20:09
Easy way to Install libsass & sassc in Ubuntu, `curl -sSL http://git.io/vnxQ4 | sudo bash`
#!/bin/bash
# Based on https://gist.github.com/edouard-lopez/503d40a5c1a49cf8ae87
set -e
# Installing dependencies
apt-get -q -y install build-essential automake libtool git
buildDir="/tmp/sass-build"