Skip to content

Instantly share code, notes, and snippets.

View ldong's full-sized avatar
❤️
Love & Peace

Alan Dong ldong

❤️
Love & Peace
  • Sunnyvale, CA
View GitHub Profile
@ldong
ldong / goinst.sh
Last active August 29, 2015 14:06 — forked from jmervine/goinst.sh
#!/usr/bin/env bash
#
# Example usage:
#
# $ VERSION=1.3 sudo ./goinst.sh
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@ldong
ldong / auto_install_sublime_packages.markdown
Created January 29, 2015 04:22 — forked from vishaltelangre/auto_install_sublime_packages.markdown
Sublime text bulk install list of packages
  • To install packages, every time pressing ' ctrl+shift+pPackage Control: Install Package is very cumbersome task... right?

  • After fresh installation of ST2, open it and ctrl+` and hit enter after pasting below line [(1)][1]:

  import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
  • Restart ST2.

  • Open terminal, and navigate to Sublime's dir under your home folder by below command and create file w/ name Package Control.sublime-settings there in:

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ldong
ldong / a.js
Last active August 29, 2015 14:20 — forked from netwjx/a.js
// many many codes
document.write('foo bar');
document.write('</div>');
// new code
var a = 'bar.js', stamp = +new Date() + '=';
document.write('<script id="foo" src="' + a + '?' + stamp + '"></script>');
// other code
document.write('<div> other text</div>');
@ldong
ldong / ruby1line.txt
Last active August 29, 2015 14:20 — forked from slyphon/ruby1line.txt
HANDY ONE-LINERS FOR RUBY November 16, 2005
compiled by David P Thomas <[email protected]> version 1.0
Latest version of this file can be found at:
http://www.fepus.net/ruby1line.txt
Last Updated: Wed Nov 16 08:35:02 CST 2005
FILE SPACING: