Skip to content

Instantly share code, notes, and snippets.

Xiuyu Li nickleefly

Block or report user

Report or block nickleefly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nickleefly /
Last active Mar 22, 2018
install terraform and packer osx
#!/usr/bin/env bash
# Script prerequisite > install jq >
cd ~
# Prerequisites
if [ "$(uname)" == "Darwin" ]; then
brew install jq
# For Linux
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
nickleefly /
Last active Jun 4, 2019
openwrt on newwifi Y1


  • [lenovo_y1_v1][1]
  • [hiwifi hc5861][8]
  • [openwrt hiwifi][9]

newwifi is MTK board(MediaTek MT7620A), find the builds for ramips

How to install

nickleefly / bench.js
Last active Mar 24, 2016
isArray bench
View bench.js
var benchmark = require('benchmark')
var benchmarks = require('beautify-benchmark')
global.isArray = require('./index')
global.assert = require('assert')
var suite = new benchmark.Suite
var assertValues = 'assert.strictEqual(obj, true);'
nickleefly / closest.js
Last active Mar 10, 2016
get closest number from an array
View closest.js
var counts = [4, 9, 15, 100, 2],
goal = 70;
function closest(array, x) {
var min,
chosen = array[0];
for (var i in array) {
min = Math.abs(x - chosen);
if (Math.abs(x - array[i]) < min) {
chosen = array[i];
nickleefly / prime-generator.js
Last active Jan 12, 2016 — forked from trevnorris/prime-generator.js
fastest js prime generator been able to get
View prime-generator.js
// Thanks to @isntitvacant ( for optimizing the
// bit shift performance tweaks.
var SB = require('buffer').SlowBuffer;
var ITER = 2e4;
var SIZE = 1e3;
function genPrimes(max) {
var primes = new Array();
var len = (max >>> 3) + 1;
# Usage:
# sudo ./
# or for next-nightly:
# sudo ./ next
if [ "X$1" == "Xnext" ]; then

Keybase proof

I hereby claim:

  • I am nickleefly on github.
  • I am 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 /
Last active Aug 29, 2018
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 /
Last active Aug 29, 2015 — forked from dergachev/
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


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

You can’t perform that action at this time.