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 | |
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 |
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/zsh -f | |
autoload -U colors | |
colors | |
print " | |
ZSH Color definitions: | |
\e[1mprompt simple\e[0m [\e[1m<\e[0mcolor1\e[1m>\e[0m[\e[1m<\e[0mcolor2\e[1m>\e[0m[\e[1m<\e[0mcolor3\e[1m>\e[0m[\e[1m<\e[0mstring1\e[1m>\e[0m[\e[1m<\e[0mstring2\e[1m>\e[0m[\e[1m<\e[0mstring3\e[1m>\e[0m]]]]]] | |
Supply up to three \e[1mcolors\e[0m and then up to three alternate static \e[1mprompt strings \e[0m. | |
\e[1mcolor1\e[0m is the local prompt color: \e[1mzsh-% \e[0m color1=default | |
\e[1mcolor2\e[0m is the remote prompt color: \e[31m$HOST:r:r-%\e[0m color2=red | |
\e[1mcolor3\e[0m is the screensession prompt color: \e[1mScreen-% \e[0m color3=default |
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
" Installing plugins to /Users/laixintao/.vim/bundle | |
Plugin 'gmarik/vundle' | |
Plugin 'Valloric/YouCompleteMe' | |
Plugin 'davidhalter/jedi-vim' | |
Plugin 'The-NERD-tree' | |
Plugin 'majutsushi/tagbar' | |
Plugin 'godlygeek/tabular' | |
Plugin 'plasticboy/vim-markdown' | |
Plugin 'kchmck/vim-coffee-script' | |
Plugin 'carlosvillu/coffeScript-VIM-Snippets' |
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
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 |
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 foo(): | |
print("foo print ") | |
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 time | |
def normal_fib(n): | |
if n == 0 or n == 1: | |
return n | |
return normal_fib(n - 1) + normal_fib(n - 2) | |
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 -*- | |
for i in range (10): | |
print(i) | |
print(i) |
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
curl -Iv https://t.tt | |
* Rebuilt URL to: https://t.tt/ | |
* Trying 140.143.118.208... | |
* TCP_NODELAY set | |
* Connected to t.tt (140.143.118.208) port 443 (#0) | |
* ALPN, offering h2 | |
* ALPN, offering http/1.1 | |
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH | |
* successfully set certificate verify locations: | |
* CAfile: /etc/ssl/cert.pem |
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
~/Downloads ipython | |
Python 3.6.3 (default, Nov 3 2017, 14:41:25) | |
Type 'copyright', 'credits' or 'license' for more information | |
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help. | |
In [1]: i = 'foo' | |
In [2]: [i for i in range(10)] | |
Out[2]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
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 a | |
print("First time import a, a.foo={}".format(a.foo)) | |
a.foo = 'bar' | |
import a | |
print("Second time import a(from sys.module), a.foo={}".format(a.foo)) | |