Skip to content

Instantly share code, notes, and snippets.

View nickleefly's full-sized avatar

Xiuyu Li nickleefly

  • Shanghai
View GitHub Profile
@nickleefly
nickleefly / Freenode IRC.md
Created May 21, 2019 09:02 — forked from yeyewangwang/Freenode IRC.md
Freenode Nickserv Commands

Connect

/server chat.freenode.net

Nick

#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ]
@nickleefly
nickleefly / README.md
Created December 20, 2017 05:44 — forked from jamesramsay/README.md
Gmail: delete old emails automatically

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at https://script.google.com
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
  • LABEL_TO_DELETE: the label that should be have old messages deleted
@nickleefly
nickleefly / npx-osx.md
Created December 10, 2017 08:40 — forked from tamzinblake/npx-osx.md
How to get npx shell auto fallback working on OSX bash

OSX ships with bash 3 by default, but you need bash 4 to use npx shell auto fallback. Using homebrew:

(instructions borrowed from https://github.com/Homebrew/homebrew-command-not-found)

brew update && brew install bash
# Add the new shell to the list of allowed shells
sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
# Change to the new shell
chsh -s /usr/local/bin/bash
@nickleefly
nickleefly / Ansible-Vault how-to.md
Created September 7, 2017 03:18 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

##Working with ansible-vault

I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

why ./task.js?

One word: task automation. It's basically zero effort and you can use the ./task.js package manager to handle any repetitive tasks. You can use ./task.js to automate everything with minimum effort.

./task.js provides the structure, order, and authority that you as a developer so desperately crave. ./task.js will also take responsibility for your actions if you need it to. It's what everybody is using now. ./task.js is the new hotness. It's all about ./task.js now, just like that.

This is compared to npm run/bash scripts, which are:

@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
@nickleefly
nickleefly / prime-generator.js
Last active January 12, 2016 09:56 — forked from trevnorris/prime-generator.js
fastest js prime generator been able to get http://jsperf.com/123123123456
// 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;
@nickleefly
nickleefly / drone.js
Created January 11, 2014 07:03 — forked from felixge/drone.js
// Done inside a repl so I can call land() when the drone is mis-behaving
// The client library will probably handle the forSec() queue stuff in the future
var client = require('.').createClient();
client.startRepl(function(err) {
if (err) throw err;
forSec(5, 'takeoff');
forSec(3, 'stop');
forSec(5, 'frontBack', -0.1);
package main
import (
"net/http"
"fmt"
"io"
"strconv"
"launchpad.net/goamz/aws"
"launchpad.net/goamz/s3"
)