Skip to content

Instantly share code, notes, and snippets.

#git
source ~/git-prompt.sh
source ~/git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\[\033[32m\]\u@\h\[\033[00m\]$(__git_ps1)\[\033[00m\]\$ '
s/!\[\](\(.*\))/<img src="\1" class="image-on-frame image-fade">
@shoya140
shoya140 / gist:7113770
Last active December 26, 2015 07:18
現在のコミットログとは別ツリーでgh-pagesブランチが作れる
git checkout --orphan gh-pages
git rm -rf .
@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() {
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
num = int(message)
q = []
while num >= 1:
q.append(num - (num/10)*10)
num = num/10
q.reverse()
@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
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
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:
var url =location.href;
var param = url.substring(url.lastIndexOf("/")+1,param);