Skip to content

Instantly share code, notes, and snippets.

@shoya140
shoya140 / gist:9050187
Created February 17, 2014 13:07
パスワード付きのzip作成
zip -e -r EXPORT_FILE_PATH.zip DIR_NAME
@shoya140
shoya140 / gist:8971319
Created February 13, 2014 07:42
shift-jisファイルをutf-8に変換
iconv -s -f SHIFT_JIS -t UTF-8 paper.tex > paper_utf8.sty
@shoya140
shoya140 / gist:8971300
Created February 13, 2014 07:40
クリップボードにシンタックスハイライト付きコードコピー
pygmentize -f rtf code.py | pbcopy
var url =location.href;
var param = url.substring(url.lastIndexOf("/")+1,param);
def quicksort(list):
if len(list) <= 1:
return list
pivot = list[0]
left = []
right = []
for val in list[1:len(list)]:
if val < pivot:
left.append(val)
else:
def merge(left, right):
res = []
while left != [] and right != []:
if left[0] < right[0]:
res.append(left.pop(0))
else:
res.append(right.pop(0))
res.extend(left)
res.extend(right)
return res
@shoya140
shoya140 / CCipher
Last active December 29, 2015 19:49
import math
import string
class CCipher:
def decode(self, cipherText, shift):
res = ""
for val in cipherText:
res = res + self.getDecodedChar(val, shift)
return res
num = int(message)
q = []
while num >= 1:
q.append(num - (num/10)*10)
num = num/10
q.reverse()
10 cls
20 for i = 1 to 100 step 1
30 for j = 2 to i/2 step 1
40 if i mod j = 0 then goto 60
50 next j
55 print i
60 next i
70 end
@shoya140
shoya140 / go.snip
Created November 2, 2013 22:15
The snippets for golang.
snippet package main
abbr simple template with importing fmt
options head
package main
import (
"fmt"
)
func main() {