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 | |
from random import randint | |
from hashlib import md5 | |
from urllib import quote | |
from urllib2 import urlopen, Request | |
from base64 import b64encode | |
def spellaccount(account, password): | |
rand = hex(randint(0x10000000, 0xffffffff))[2:].upper() | |
perfix, ver, key = "~ghca", "2007", "jepyid" |
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
def _get_whoosh_schema_and_primary_key(model, analyzer): | |
schema = {} | |
primary = None | |
searchable = set(model.__searchable__) | |
for field in model.__table__.columns: | |
if field.primary_key: | |
schema[field.name] = whoosh.fields.ID(stored=True, unique=True) | |
primary = field.name |
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
{ | |
"dpi_scale": 1.3, // dpi缩放比,适配高分辨率屏幕 | |
"font_size": 13, // 字号 | |
"font_face": "Ubuntu Mono", // 字体 | |
"save_on_focus_lost": true, // 失去焦点自动保存 | |
"ensure_newline_at_eof_on_save": true, // 保存时自动在文件末空行 | |
"trim_trailing_white_space_on_save": true, // 保存时自动移出行末空格 |
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
def main(): | |
key_list = "" | |
for i in xrange(10000000, 1000000000): | |
key_list = key_list + str(i) + "\n" | |
if len(key_list) > 10000: | |
with open("./passwd1.txt", "a+") as f: | |
f.write(key_list) | |
# del key_list | |
key_list = "" | |
print "done" |
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
function foo() { | |
var start_time = new Date().getTime() | |
things = [16, 8, 256, 3, 2, 32, 4] | |
for (var i = 10000001; i >= 0; i--) { | |
for (var day = things.length - 1; day >= 0; day--) { | |
var result | |
switch (things[day]) { | |
case 16: | |
result = 4 | |
break |
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
def fact(n): | |
if n == 0: | |
return 1 | |
else: | |
return n * fact(n - 1) | |
def fact_cps(n, k=lambda x: x): | |
if n == 0: | |
return k(1) | |
else: |
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
def calc(exp : Array | Float64 | Int32 | Symbol) : Int32 | Float64 | |
if exp.is_a?(Float64 | Int32) | |
return exp | |
elsif exp.is_a?(Symbol) | |
raise "not support" | |
else | |
v1, v2 = calc(exp[1]), calc(exp[2]) | |
case exp[0] | |
when :+ | |
return v1 + v2 |
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
" Theme settings | |
let g:gruvbox_italic=0 | |
let g:gruvbox_underline=0 | |
let g:gruvbox_invert_indent_guides=1 | |
let g:gruvbox_improved_warnings=1 | |
colorscheme gruvbox | |
set background=dark | |
set nu |
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=zsh ts=2 sw=2 sts=2 | |
# | |
# agnoster's Theme - https://gist.github.com/3712874 | |
# A Powerline-inspired theme for ZSH | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need a | |
# [Powerline-patched font](https://gist.github.com/1595572). | |
# |
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
class Monomorphic(object): | |
def __init__(self, name): | |
self.name = name | |
def __repr__(self): | |
return super(Monomorphic, self).__repr__() | |
def apply_sub(self): | |
pass |
OlderNewer