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 http = require('http');
var urls = process.argv.slice(2);
var bufferString = '';
var counter = 0;
var canContinue = true;
while(!!urls.length && canContinue) {
@zhuangya
zhuangya / -
Created September 11, 2013 15:50
ack
aget
amap
aria2
arping
asciiio
aspell
autoconf
automake
axel
helloword
(function() {
function addEvent(obj, event, fn, capture) {
if(window.attachEvent) {
obj.attachEvent('on' + event, fn);
} else {
if(!capture) capture = false;
obj.addEventListener(event, fn, capture);
}
}
var generator = function(params) {
@zhuangya
zhuangya / index.html
Created August 20, 2013 17:41
break the page by css.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Page break test </title>
<link rel="stylesheet" media="all" href="./style.css">
</head>
<body>
<div class="page"> Page 1 </div>
<div class="page"> Page 2 </div>
require 'sinatra'
require 'rqrcode_png'
get '/' do
qs = @env['rack.request.query_hash']
text = qs['url']
qr_png = RQRCode::QRCode.new(text, :size => 32).to_img
content_type 'image/png'
qr_png.to_blob
end
var mysql = require('mysql');
var connection = mysql.createConnection({
host: 'localhost',
user: 'vimscripts',
password: 'vimscripts',
database: 'vimscripts'
});
connection.connect(function(err) {
if(err) throw err
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'
Bundle 'jceb/vim-orgmode'
Bundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim'}
Bundle 'zeis/vim-kolor'
Bundle 'gcmt/breeze.vim'
var request = require('request');
var cheerio = require('cheerio');
var Q = require('q');
var orm = require('orm');
function getVimPageUrl(page, perPage) {
var showMe = perPage >>>0 || 20;
var resultPtr = (page >>> 0 || 0) * showMe;
var baseUrl = 'http://www.vim.org/scripts/script_search_results.php?';
@zhuangya
zhuangya / dabblet.css
Created August 7, 2013 13:21 — forked from anonymous/dabblet.css
Untitled
.highlight img {
display: block;
width: 160px;
height: 160px;
border-radius: 100%;
}
.highlight {
width: 160px;