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
View 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])))*$)
@nickleefly
nickleefly / tabletop.html
Last active Aug 29, 2015
save a console output to a file
View tabletop.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="TimelineJS example">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<!-- jQuery -->
@nickleefly
nickleefly / hello.go
Created Mar 24, 2014
webserver in go lang
View hello.go
package main
import (
"fmt"
"log"
"net/http"
)
func sayHello(responseWriter http.ResponseWriter, request *http.Request) {
request.ParseForm() //解析表单参数
@nickleefly
nickleefly / index.js
Created May 22, 2014
requirebin sketch
View index.js
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@nickleefly
nickleefly / index.js
Created May 31, 2014
requirebin sketch
View index.js
var moment = require('moment')
var data = {y: 2010, M: 3, d: 5, h: 15, m: 10, s: 3, ms: 123}
var result = moment(data).format('YYYY-MM-DD')
console.log(result)
View nodeschool.md

browserify data-plumber levelmeup nodebot bug-clinic goingnative makemehapi npm-tutor shader-school

@nickleefly
nickleefly / streamout.js
Created Aug 21, 2014
stream data into a file
View streamout.js
var fs = require('fs')
var wstream = fs.createWriteStream('myfile.csv')
wstream.write('id, title, rating, zipcode\n')
wstream.write('1, my title, 5, 94402\n')
wstream.end()
@nickleefly
nickleefly / stream-write.js
Last active Aug 29, 2015
writeStream create data
View stream-write.js
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) {
@nickleefly
nickleefly / mixins.styl
Last active Aug 29, 2015
stylus usage 'stylus < my.styl'
View mixins.styl
border-radius()
-webkit-border-radius: arguments
-moz-border-radius: arguments
border-radius: arguments
View branch-by-date.md
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
You can’t perform that action at this time.