Skip to content

Instantly share code, notes, and snippets.

View hungneox's full-sized avatar
✌️

Hung Neo hungneox

✌️
View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise32"
config.vm.synced_folder "./", "/var/www", id: "vagrant-root",
owner: "vagrant",
group: "www-data",
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
usage:
cat about.txt | python soinput.py
'''
import sys
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
{
"directory": "components"
}

How to install PhantomJS on Ubuntu

Version: 1.9.7

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
@hungneox
hungneox / cs-jq-plugin-template.coffee
Last active September 21, 2015 11:02 — forked from rjz/cs-jq-plugin-template.coffee
Coffeescript jQuery Plugin Class Template
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
(($, window) ->
@hungneox
hungneox / 0_reuse_code.js
Created November 11, 2015 13:19
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
@hungneox
hungneox / eloquent.md
Created November 16, 2015 14:01 — forked from msurguy/eloquent.md
Laravel 4 Eloquent Cheat Sheet.

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

@hungneox
hungneox / deploy.yaml
Created May 24, 2016 11:29 — forked from mblarsen/deploy.yaml
Solution for `git clone` using Ansible for repos with private submodules with github deploy keys
# Problem:
#
# If you use git submodules linking two private github repos, you'll need to create a separate deploy key for each.
# Multiple keys are not supported by Ansible, nor does ansible (when running git module) resort to your `.ssh/config` file.
# This means your ansible playbook will hang in this case.
#
# You can however use the ansible git module to checkout your repo in multiple steps, like this:
#
- hosts: webserver
vars:
@hungneox
hungneox / ModuleAServiceProvider.php
Created June 2, 2016 11:03 — forked from thepsion5/ModuleAServiceProvider.php
Simple Module Concept for Laravel 5
<?php
namespace App\Providers;
use Illuminate\Support\ModuleServiceProvider;
class FooModuleServiceProvider extends ModuleServiceProvider
{
protected $moduleName = 'Foo Module';
protected $moduleNamespaces = ['App\FooModule'];