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
| #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\]\$ ' |
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
| s/!\[\](\(.*\))/<img src="\1" class="image-on-frame image-fade"> |
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
| git checkout --orphan gh-pages | |
| git rm -rf . |
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
| snippet package main | |
| abbr simple template with importing fmt | |
| options head | |
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| func main() { |
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
| 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 |
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
| num = int(message) | |
| q = [] | |
| while num >= 1: | |
| q.append(num - (num/10)*10) | |
| num = num/10 | |
| q.reverse() |
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
| import math | |
| import string | |
| class CCipher: | |
| def decode(self, cipherText, shift): | |
| res = "" | |
| for val in cipherText: | |
| res = res + self.getDecodedChar(val, shift) | |
| return res |
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
| 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 |
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
| 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: |
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
| var url =location.href; | |
| var param = url.substring(url.lastIndexOf("/")+1,param); |