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
nickleefly / install-terraform-packer.sh
Last active Mar 22, 2018
install terraform and packer osx
View install-terraform-packer.sh
#!/usr/bin/env bash
# Script prerequisite > install jq > https://stedolan.github.io/jq/download/
cd ~
# Prerequisites
if [ "$(uname)" == "Darwin" ]; then
brew install jq
# For Linux
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
@nickleefly
nickleefly / readme.md
Last active Jun 4, 2019
openwrt on newwifi Y1
View readme.md

Resources:

  • [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
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);'
suite.add({
@nickleefly
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
nickleefly / prime-generator.js
Last active Jan 12, 2016 — forked from trevnorris/prime-generator.js
fastest js prime generator been able to get http://jsperf.com/123123123456
View prime-generator.js
// Thanks to @isntitvacant (https://github.com/chrisdickinson) 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;
View install-iojs-nightly.sh
#!/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
View keybase.md

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 Aug 29, 2018
setup osx brew install
View brew-install.sh
# 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 Aug 29, 2015 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

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:

You can’t perform that action at this time.