Skip to content

Instantly share code, notes, and snippets.

View nickleefly's full-sized avatar

Xiuyu Li nickleefly

  • Shanghai
View GitHub Profile
@nickleefly
nickleefly / install-iojs-nightly.sh
Last active February 19, 2016 10:35 — forked from isaacs/node-and-npm-in-30-seconds.sh
Install node.js and io.js
#!/bin/bash
# Usage:
# sudo ./install-iojs-nightly.sh
# or for next-nightly:
# sudo ./install-iojs-nightly.sh next
type=nightly
if [ "X$1" == "Xnext" ]; then
type=next-nightly

Keybase proof

I hereby claim:

  • I am nickleefly on github.
  • I am nickleefly (https://keybase.io/nickleefly) on keybase.
  • I have a public key whose fingerprint is 0AFD 9D6A F5D9 9F70 5E95 913B B28E 7EC0 B478 99EB

To claim this, I am signing this object:

@nickleefly
nickleefly / brew-install.sh
Last active December 13, 2021 21:05
setup osx brew install
# brew list
brew install bash-completion
brew install nodejs
brew install wget
brew install unicodechecker
brew install ipv6toolkit
brew install ack
brew install the_silver_searcher
brew install wifi-password
brew install tmux
@nickleefly
nickleefly / GIF-Screencast-OSX.md
Last active August 29, 2015 14:16 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

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:

@nickleefly
nickleefly / .proxychains.conf
Last active August 29, 2015 14:15
proxychains
strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
localnet 127.0.0.0/255.0.0.0
quiet_mode
[ProxyList]
socks5 127.0.0.1 1080
@nickleefly
nickleefly / .zshrc
Last active August 29, 2015 14:14 — forked from SlexAxton/.zshrc
gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@nickleefly
nickleefly / leveldb.js
Created January 26, 2015 02:59
read a list of data from levelup
var mkdirp = require('mkdirp')
var path = require('path')
var HOME = process.env.HOME
var dir = path.join(HOME, 'dprk.db')
mkdirp.sync(dir)
var db = require('levelup')(dir, {encoding: 'json'})
db.put(
'dprk'
, {
git branch -vv --color=always | while read; do echo -e $(git log -1 --format=%ci $(echo "_$REPLY" | awk '{print $2}' | perl -pe 's/\e\[?.*?[\@-~]//g') 2> /dev/null || git log -1 --format=%ci)" $REPLY"; done | sort -r | cut -d ' ' -f -1,4-

git for-each-ref --format='%(committerdate:iso8601) %(committerdate:relative) %(refname)' --sort -committerdate
git for-each-ref --format='%(committerdate:iso8601) %(committerdate:relative) %(refname)' --sort -committerdate refs/heads/
git for-each-ref --format='%(committerdate:short),%(authorname),%(refname:short)' --sort=committerdate refs/heads/ | column -t -s ','

for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
for branch in `git branch -l | grep -v '*'`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@nickleefly
nickleefly / mixins.styl
Last active August 29, 2015 14:11
stylus usage 'stylus < my.styl'
border-radius()
-webkit-border-radius: arguments
-moz-border-radius: arguments
border-radius: arguments
@nickleefly
nickleefly / stream-write.js
Last active August 29, 2015 14:05
writeStream create data
var GraphModel = require('../models/graphModel.js');
var fs = require('fs');
var moment = require('moment');
/**
Provides the controllers for the application views
@module api/controllers
**/
exports.controller = function(req, res) {