Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* @author Simon Holywell <treffynnon@php.net>
*/
class LazyLoadingProxy {
/**
* Where the instance of the actual class is stored.
* @var $instance object
*/
private $instance = null;
<?php
class Curl {
/**
* cURL request method
*
* @var string
*/
protected $_method = 'GET';
{
"globals": {
"assert" : true,
"define" : true,
"require" : true,
"module" : true,
"exports" : true,
"$" : true,
"jQuery" : true,
"_" : true,
@andorx
andorx / .jscsrc
Last active August 29, 2015 14:16
{
"preset": "google",
"fileExtensions": [ ".js", "jscs" ],
"requireParenthesesAroundIIFE": true,
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
"maximumLineLength": 120,
"validateLineBreaks": "LF",
"validateIndentation": 2,
@andorx
andorx / tmux.conf
Last active November 23, 2017 02:40
Tmxu Config
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
@andorx
andorx / happy_git_on_osx.md
Created March 3, 2016 12:47 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@andorx
andorx / tree.sh
Last active November 23, 2017 02:05
Print out directory tree
> find . -type d | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
Output:
.
|-bin
|-src
| |-apps
| | |-__pycache__
| | |-accounts
| | | |-__pycache__
@andorx
andorx / generated.css
Last active November 23, 2017 02:41
SCSS - Pull the selector out of its parent
a.post {
display: block;
}
@andorx
andorx / git-rewrite-author.sh
Created July 14, 2016 11:04
Rewrite incorrect commit author info
#!/bin/sh
git filter-branch -f --env-filter '
OLD_EMAIL="duc.pham@tiki.com"
CORRECT_NAME="Duc N. PHAM"
CORRECT_EMAIL="pngduc@lazada.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
@andorx
andorx / push-subdir-into-main-repo.txt
Created July 14, 2016 11:07
Git push a sub-directory into other main repository
git clone <ORIG_REPO_DIR> <NEW_REPO_DIR>
cd <NEW_REPO_DIR>
git filter-branch --prune-empty --subdirectory-filter <THE_SUBDIR_TO_MAKE_NEW_ROOTDIR> master
git push <MY_NEW_REMOTE_ORIGIN_URL> -f .