Skip to content

Instantly share code, notes, and snippets.

View d6u's full-sized avatar

Daiwei Lu d6u

View GitHub Profile
@d6u
d6u / retina.less
Last active August 29, 2015 14:02
@highdpi: ~"(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";
@d6u
d6u / git.sh
Created June 18, 2014 13:21
git commands
git cherry $(git merge-base --fork-point master) -v --abbrev
@d6u
d6u / standup.js
Last active August 29, 2015 14:04
// Usage:
// $ node standup.js
//
// Specify distance of days to look back
// $ node standup.js -d 7 # look back 7 days
//
// It have auto author detection, so you don't have to specify any user
//
// It also has auto Monday correction, so on Monday, if you didn't specify `-d`,
// it will auto use 3 days range
@d6u
d6u / flex_sdk.rb
Last active August 29, 2015 14:05 — forked from rjungemann/flash_player.rb
# brew install "https://gist.githubusercontent.com/daiweilu/c62631ac4de8d37e05f2/raw/74353db12db030468edaa4c30e8a124a0c414dc7/flex_sdk.rb"
require 'formula'
class FlexSdk < Formula
homepage "http://www.adobe.com/devnet/flex.html"
url "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip"
sha1 "7e66e84bef09e8c2c3183acf548c41d8114516ca"
def install
@d6u
d6u / config.fish
Last active August 29, 2015 14:06 — forked from andrewytliu/config.fish
# in ~/.config/fish/config.fish
# Load the default rubies
if test -z $rvm_bin_path
exec bash --login -c "exec fish"
end
@d6u
d6u / syslog-ng.conf
Created October 9, 2014 23:27
syslog-ng config files
@version: 3.5
@include "scl.conf"
@include "`scl-root`/system/tty10.conf"
# Syslog-ng configuration file, compatible with default Debian syslogd
# installation.
# First, set some global options.
options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no);
owner("root"); group("adm"); perm(0640); stats_freq(0);
@d6u
d6u / bash.sh
Created October 21, 2014 22:52
# check empty dir
if [[ -z $(ls -A $DIR) ]]
then
echo "empty"
else
echo "not empty"
fi
@d6u
d6u / mongodb-adduser.js
Created October 22, 2014 18:10
mongodb common notes
conn = new Mongo();
db = conn.getDB('admin');
db.createUser({
user: 'siteUserAdmin',
pwd: 'password',
roles: [{
role: 'userAdminAnyDatabase',
db: 'admin'
@d6u
d6u / inst737-tweet.js
Last active August 29, 2015 14:08
inst737
{ _id: { type: [ 'Object' ] },
created_at: { type: [ 'String' ] },
id: { type: [ 'Number' ] },
id_str: { type: [ 'String' ] },
text: { type: [ 'String' ] },
source: { type: [ 'String' ] },
truncated: { type: [ 'Boolean' ] },
in_reply_to_status_id: { type: [ 'Null', 'Number' ] },
in_reply_to_status_id_str: { type: [ 'Null', 'String' ] },
in_reply_to_user_id: { type: [ 'Number', 'Null' ] },