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
#include <iostream> | |
#include <vector> | |
#include <sstream> | |
#include <cstdio> | |
#include <set> | |
using namespace std; | |
#define FORI for(int i = 0; i < n; ++i) | |
#define FORJ for(int j = 0; j < n; ++j) |
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 python | |
import sys | |
import os | |
import logging | |
import tempfile | |
import urllib | |
import subprocess | |
lang2Name = {'af': 'Afrikaans', |
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 python | |
import sys | |
import logging | |
import os | |
def fixname(f, encoding): | |
newfname = f.decode('utf8').encode('iso8859-1').decode(encoding).encode('utf8') | |
os.rename(f, newfname) | |
logging.info('rename %s -> %s' % (f, newfname)) |
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 python | |
import string | |
import random | |
import sys | |
def getPassword(length): | |
a = string.letters + string.digits | |
res = ''.join([random.choice(a) for i in range(length)]) | |
return res |
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 python | |
import logging | |
import sys | |
log = logging.getLogger(__name__) | |
def main(): | |
lines = file('debian/control').readlines() |
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
javascript:(function(){h='m.rememberthemilk.com';p='/add';if(window.getSelection){t=window.getSelection();}else%20if(document.getSelection){t=document.getSelection();}else%20if(document.selection){t=document.selection.createRange().text;};cp='http://'+h+p+'?name='+((null==t||t==""||t==undefined)?encodeURIComponent(document.title):t)+'&url='+encodeURIComponent(location.href);w=window.open(cp,'addwindow','status=no,toolbar=no,width=250,height=560,resizable=yes');setTimeout(function(){w.focus();},500);})(); |
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 python | |
import sys | |
import os | |
import random | |
def parse_size(s): | |
s = s.lower() | |
base = 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
set ai | |
"set guioptions-=m | |
set guioptions-=T | |
"set textwidth=72 | |
"set background=light | |
set wrap | |
set nocp | |
syntax on | |
filetype on | |
filetype indent on |
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
#!/bin/sh | |
svn commit --no-auth-cache --username "$@" |
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 python | |
# Usage: | |
# This script will generate two files(vpnup and vpndown) after executing. | |
# Do chmod a+x on the two newly created files, and then move them to the | |
# openvpn config folder. then add the following two lines to the vpn config file: | |
# up vpnup | |
# down vpndown | |
# you might also need 'redirect-gateway' in the config file, if you don't use vpn | |
# as the default gateway. |
OlderNewer