This file contains 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/bash | |
set -e | |
if [[ $# -eq 0 || x$1 =~ x-h|x--help ]]; then | |
PROG=$(basename $0) | |
echo "" | |
echo "Usage: $PROG command [args...]" | |
echo "Run command in docker container of firedrake." | |
echo "" |
This file contains 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/env python3 | |
import os | |
import sys | |
if len(sys.argv) < 2: | |
print('Usage: sys.argv[0] <script>') | |
exit(0) | |
scripts = sys.argv[1] |
This file contains 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
bhosts | grep ok | cut -d" " -f1 | while read a; do if rsh $a test >/dev/null 2>&1; then echo $a; fi done |
This file contains 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
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ |
This file contains 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
unbind C-b | |
set -g prefix C-a | |
setw -g mode-keys vi | |
# split window like vim | |
# vim's defination of a horizontal/vertical split is revised from tumx's | |
bind s split-window -h | |
bind v split-window -v | |
# move arount panes wiht hjkl, as one would in vim after C-w | |
bind h select-pane -L |
This file contains 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
alias cdnote='cd ~/repo/note-code/note' | |
alias lisp='if tmux ls 2>/dev/null | grep lisp >/dev/null 2>&1; then tmux a -t lisp ; else tmux new -s lisp \; splitw -l6 guile \; selectp -t 0; fi' | |
alias note='if tmux ls 2>/dev/null | grep note >/dev/null 2>&1; then tmux a -t note ; else tmux new -s note\; splitw -v -l6 \; selectp -t 0; fi' |
This file contains 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
<p id="chiristmas" style="font-size: xx-large;"> </p> | |
<script type="text/javascript">// <![CDATA[ | |
var now =new Date(); | |
var new_year = new Date("Dec 25, 2012 0:0:0"); | |
var num_of_yoi = 1+( new_year.getTime() - now.getTime())/ 86400000; | |
field= document.getElementById('chiristmas'); | |
var yois = ""; | |
This file contains 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
require 'digest/md5' | |
def gfm(text) | |
# Extract pre blocks | |
extractions = {} | |
text.gsub!(%r{<pre>.*?</pre>}m) do |match| | |
md5 = Digest::MD5.hexdigest(match) | |
extractions[md5] = match | |
"{gfm-extraction-#{md5}}" | |
end |
This file contains 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
require 'digest/md5' | |
def gfm(text) | |
# Extract pre blocks | |
extractions = {} | |
text.gsub!(%r{<pre>.*?</pre>}m) do |match| | |
md5 = Digest::MD5.hexdigest(match) | |
extractions[md5] = match | |
"{gfm-extraction-#{md5}}" | |
end |
NewerOlder