Skip to content

Instantly share code, notes, and snippets.

View nickleefly's full-sized avatar

Xiuyu Li nickleefly

  • Shanghai
View GitHub Profile
@nickleefly
nickleefly / answers.md
Created February 27, 2014 02:53 — forked from jpsim/answers.md
  1. Plain Strings (207): foo
  2. Anchors (208): k$
  3. Ranges (202): ^[a-f]*$
  4. Backrefs (201): (...).*\1
  5. Abba (169): ^(.(?!(ll|ss|mm|rr|tt|ff|cc|bb)))*$|^n|ef
  6. A man, a plan (177): ^(.)[^p].*\1$
  7. Prime (286): ^(?!(..+)\1+$)
  8. Four (199): (.)(.\1){3}
  9. Order (198): ^[^o].....?$
  10. Triples (507): (^39|^44)|(^([0369]|([147][0369]*[258])|(([258]|[147][0369]*[147])([0369]*|[258][0369]*[147])([147]|[258][0369]*[258])))*$)
package main
import (
"net/http"
"fmt"
"io"
"strconv"
"launchpad.net/goamz/aws"
"launchpad.net/goamz/s3"
)
@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);
@nickleefly
nickleefly / ci.sh
Created August 30, 2013 10:45 — forked from juliangruber/ci.sh
function ci() {
echo -e "$(testlingify &> /dev/null && testlingify badge)\n\n\
$(travisify &> /dev/null && travisify badge)"
}
# with nodei.co badge
function ci() {
name=$(node -pe 'require("./package").name')
echo -e "[![NPM](https://nodei.co/npm/$name.png)](https://nodei.co/npm/$name)\n\n\

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
#!/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 / gemspec-usage.md
Created November 29, 2012 13:20 — forked from holman/gemspec-usage.md
test/spec/mini

Just install this in your apps like so:

gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'