This file contains hidden or 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 | |
# you need to write title in Front Matter of each post like: | |
# --- | |
# title: SOME TITLE | |
# --- | |
# require: | |
# https://github.com/shokai/tw | |
tw_ID="{{ your twitter ID registered in tw }}" | |
cname="{{ your GitHub Pages' CNAME }}" |
This file contains hidden or 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
$PREFIXES: null, -moz-, -webkit-; | |
@mixin prefix($property, $value){ | |
@each $prefix in $PREFIXES{ | |
#{$prefix}#{$property}: $value; | |
} | |
} |
This file contains hidden or 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
ary=(`ls -1 *.*`);for i in $(seq -w `ls -U1 | wc -l`);do;mv $ary[i] $i"."${ary[$i]##*.};done |
This file contains hidden or 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
# coding: utf-8 | |
import sys | |
import time | |
from ctypes import windll | |
user32 = windll.user32 | |
def detector(keycode=69): |
This file contains hidden or 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
# famous | |
def gcd(a, b): | |
if b: | |
return gcd(b, a%b) | |
return a | |
# non-recursive | |
def Gcd(a, b): | |
while b: | |
a, b = b, a%b |
This file contains hidden or 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 python3 | |
# codin: utf-8 | |
# memoizing decorator | |
def memoize(function): | |
def _memoize(*args, _cache={}): | |
if args in _cache: | |
print('return using cached') # just for logging | |
return _cache[args] |
NewerOlder