Skip to content

Instantly share code, notes, and snippets.

View zhuangya's full-sized avatar
🧛‍♂️
The only silver bullet is a silver bullet.

Ya Zhuang zhuangya

🧛‍♂️
The only silver bullet is a silver bullet.
View GitHub Profile
var fs = require('fs');
var http = require('http');
if(!Array.prototype.last) {
Array.prototype.last = function() {
return this[this.length - 1];
};
}
http.createServer(function(req, res) {
curl -IL http://store.apple.com/go/country/cn/home
HTTP/1.1 303 See Other
Cache-Control: no-store, private, must-revalidate, proxy-revalidate, max-age=0, pre-check=0, post-check=0, no-cache
Expires: Mon, 22 Jul 2013 06:39:15 GMT
Content-Type: text/html; charset=UTF-8; encoding=UTF8
Last-Modified: Tue, 23 Jul 2013 06:39:15 GMT
x-request-id: 6f70ebd5-43d8-49d8-8767-eee6f9319c51
Location: /cn
Pragma: no-cache
Content-Length: 0
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'wakatime/vim-wakatime'
Bundle 'joeytwiddle/sexy_scroller.vim'
let g:SexyScroller_EasingStyle=3
Bundle 'Yggdroot/indentLine'
Bundle 'mbbill/undotree'
#!/bin/sh
IPADDR=$(curl ifconfig.me/ip)
if [[ "${IPADDR}" != $(cat ~/.current_ip) ]]
then
echo "Your new ip address is ${IPADDR}" | mail -s "IP Address change" ____________@gmail.com
echo ${IPADDR} > ~/.current_ip
fi
@zhuangya
zhuangya / m.coffee
Last active December 19, 2015 18:28
nodemailer = require 'nodemailer'
http = require 'http'
q = require 'q'
oldIp = ''
opt = {
from: '___'
pass: '___'
to: '___'
@zhuangya
zhuangya / qts.coffee
Created July 13, 2013 17:45
implenent stack using queue
class Queue
constructor: (@value)->
@value = @value or []
enqueue: (what) ->
@value.push what
dequeue: ->
stash = []
ret = @value[0]
% bower install ~/Projects/Fanfou
bower cloning git://github.com/angular/bower-angular.git
bower caching git://github.com/angular/bower-angular.git
bower cloning git://github.com/components/jquery.git
bower cloning git://github.com/bestiejs/json3.git
bower cloning git://github.com/kriskowal/es5-shim
bower caching git://github.com/components/jquery.git
bower caching git://github.com/bestiejs/json3.git
bower caching git://github.com/kriskowal/es5-shim
bower cloning git://github.com/jlong/sass-twitter-bootstrap
» yo angular Unify
Would you like to include Twitter Bootstrap? (Y/n) y
If so, would you like to use Twitter Bootstrap for Compass (as opposed to vanilla CSS)? (Y/n) y
Would you like to include angular-resource.js? (Y/n) u
Would you like to include angular-cookies.js? (Y/n) y
Would you like to include angular-sanitize.js? (Y/n) y
create app/styles/main.scss
create app/styles/_compass_twitter_bootstrap.scss
create app/styles/_compass_twitter_bootstrap_awesome.scss
create app/styles/_compass_twitter_bootstrap_responsive.scss
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'
Bundle 'gcmt/breeze.vim'
Bundle 'rizzatti/funcoo.vim'
Bundle 'rizzatti/dash.vim'
Bundle 'Floobits/floobits-vim'
@zhuangya
zhuangya / colors.html
Last active December 18, 2015 15:19
parse string to int by the minors method.
<!doctype html>
<html lang="zh" ng-app="colorApp">
<head><meta charset="utf-8"><title>Website</title>
<style>
.block { width: 64px; height: 64px; display: inline-block;}
label { display: block; padding: 6px; background-color: #f5f5f5; }
</style>
</head><body>
<div ng-controller="Ctrl">