This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name get-urls-from-kuai.xunlei.js | |
// @description get urls from kuai.xunlei.com | |
// @namespace http://yourwebsite.com | |
// @version 0.1.0 | |
// @author Jokester ( github/jokester ) | |
// @license MIT | |
// @released 2013-04-02 | |
// @updated 2013-04-02 | |
// @match *://kuai.xunlei.com/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://zh.wikipedia.org/wiki/%E7%99%BE%E5%AE%B6%E5%A7%93 | |
JSON.stringify( | |
$.makeArray( | |
$("table.wikitable td:nth-child(2)").map( function(_,node){ return node.textContent; } ) | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
TEX = FileList["*.tex"] | |
PDF = TEX.ext ".pdf" | |
DEP = FileList["*/*.tex"] | |
TEX.zip(PDF).each do |tex,pdf| | |
file pdf => [ tex, DEP ].flatten do | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
import random | |
from array import array | |
from bisect import bisect_left, bisect_right | |
from timeit import repeat | |
class Distribution: | |
"""Generate random integers according to a specific function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def merge_cidr(segments_regex) | |
segments = segments_regex.map do |s| | |
(0..255).map(&:to_s).grep(/^#{s}$/).map(&:to_i) | |
end | |
memo = [] | |
segments.each do |s| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// | |
// @id www.amazon.com-b556bb6f-ee56-4bea-b588-998dc5bb4777@scriptish | |
// | |
// @namespace http://userscript.org/~hitsmaxft | |
// | |
// @name Kindle Library Powerpack | |
// | |
// @version 2.6.1 | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" vim: ft=vim | |
"appearance | |
set guioptions-=T | |
set guioptions-=m | |
"platform dependent settings | |
if(has("win32") || has("win95") || has("win64") || has("win16")) | |
"win | |
set lines=40 | |
set columns=120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: ft=perl | |
use File::Which qw/ which /; | |
use Data::Dumper; | |
$pdf_mode = 1; # use pdflatex | |
$pdflatex = "pdflatex -file-line-error -halt-on-error"; | |
&find_pdf_previewer(\$pdf_previewer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do -> | |
String.prototype.to_proc = (args...)-> | |
method = @ | |
(obj)->obj[method].apply(obj, args...) | |
console.log "a b c".split(/\s/).map (i)->i["toUpperCase"]() | |
# => [ "A", "B", "C" ] | |
console.log "a b c".split(/\s/).map "toUpperCase".to_proc() | |
# => [ "A", "B", "C" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" vim: ft=vim | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
" detect / switch encoding | |
Bundle 'mbbill/fencview' |