Skip to content

Instantly share code, notes, and snippets.

View ch0c01d's full-sized avatar

Egar Rizki ch0c01d

View GitHub Profile
<?php
/**
* Underscore.php v1.0
* Copyright (c) 2013 Jonathan Aquino
*
* This is a fork of Brian Haveri's Underscore.php. I have removed the
* object-oriented way of calling the functions, and changed all functions to
* static. This eliminates the E_STRICT warnings under PHP >=5.4.
*

Keybase proof

I hereby claim:

  • I am ch0c01d on github.
  • I am ch0c01d (https://keybase.io/ch0c01d) on keybase.
  • I have a public key whose fingerprint is 5264 6638 AD80 2AF5 C71A D505 B7EC 2C8F 6597 4DE5

To claim this, I am signing this object:

@ch0c01d
ch0c01d / mingw.sh
Created June 20, 2016 15:44
MingW Installer Mac OS
#!/bin/sh
# mingw
PREFIX="/usr/local/mingw"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
mkdir source
mkdir $PREFIX
@ch0c01d
ch0c01d / ngrok-install.md
Created June 18, 2016 21:38
Expose localhost to the internet with Ngrok

Expose Localhost to the Internet With Ngrok

If you want a way to access your localhost easily on the public internet, lets say, to showcase the current work to a client, etc. This is where ngrok comes in. It allows us to establish a tunnel that forwards a port on our machine and make it available on the internet.

Ngrok is a Go program, distributed as a single executable file for all major desktop platforms. There are no additional frameworks to install or other dependencies.

This tutorial assumes you are using MAMP and have previously set up DNSMASQ.

@ch0c01d
ch0c01d / MAMP_Dynamic_Virtual_Hosts.md
Created June 18, 2016 21:38
Simplify Local Development with MAMP & DNSMASQ (& XIP.io)

Simplify Local Development with MAMP & DNSMASQ

When you sit down and start a new project, often times, you'll want to set up a virtual host, a spoof domain that will emulate a live environment. The effort is usually two parts: set up a domain in /etc/hosts, and then add a <VirtualHost> entry in /Applications/MAMP/conf/apache/httpd.conf to make your files accessible.

This tutorial is setting up a 'zero-configuration' development environment. We'll be setting up a spoof domain ending in .dev. In MAMP, we'll create a folder called dev. Any folder inside, the name will become the domain.

@ch0c01d
ch0c01d / .bash_ngrok
Created June 18, 2016 21:29
BASHRC for Ngrok configuration
ngrok_tunnel() {
website=$1
subdomain=$2
username=$3
password=$4
[ -n $website ] && website="-host-header=${website}" || (echo "Onii-sama, dev yg mana yg mau di publish ?" && exit)
[ -n $subdomain ] && subdomain="-subdomain=${subdomain}"
if [[ -n $username ]] && [[ -n $password ]]; then
httpauth="-httpauth=${username}:${password}"
@ch0c01d
ch0c01d / Mass Update
Created July 18, 2015 12:46
Mass Github update
#!bin/bash
#Coded By Egar Rizki [ Ch0c01d ]
for dir in `ls` ; do
if [-d $dir]; then
echo [ + ] Updating $dir
cd $dir
git pull
cd ..
fi