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
#! /usr/bin/env ruby | |
if ARGV.empty? | |
puts "Usage: git-change-history base [new-branch-name]" | |
puts " a list of SHA-1 for commits are given on STDIN. These are commits are added onto base" | |
puts "Example:" | |
puts " git log --pretty=\"%H\" master | git-change-history.rb base mynewbranch" | |
puts "" | |
puts "Use 'git log --pretty=\"%H %s\"' to test if you have the right SHA-1 commit hashes listed" | |
exit |
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
function fish_prompt | |
echo -n '[' | |
set_color $fish_color_cwd | |
echo -n (basename $PWD) | |
set_color normal | |
echo -n '] $ ' | |
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
# Make the blue color for directories more readable | |
set -x LSCOLORS Exfxcxdxbxegedabagacad | |
# this is needed to avoid strange python stack backtrace complaining about UTF-8 when | |
# running sphinx. Found it by googling | |
set -x LC_ALL en_US.UTF-8 | |
set -x LANG en_US.UTF-8 | |
set -x JULIA_EDITOR textmate | |
# so our brew install override the commands from the system |
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
[difftool "sourcetree"] | |
cmd = opendiff \"$LOCAL\" \"$REMOTE\" | |
[mergetool "sourcetree"] | |
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" | |
trustExitCode = true | |
[alias] | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit |
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
# check if A is congruent to B modulo C. | |
in_same_equivalence_class(A, B, C) = mod(A, C) == mod(B, C) | |
# find all X in Xs where X is congruent to B modulo C | |
function find_numbers_in_same_equivalence_class(A, C, Xs) | |
r = mod(A, C) | |
filter(X->mod(X,C) == r, Xs) | |
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
mod(A, C) == r | |
# then | |
mod(A + k*C, C) == r | |
# so if | |
mod(A, C) == mod(B, C) |
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
#!/usr/bin/env julia | |
using PList | |
import GoTMSupport | |
bundle_support = ENV["TM_BUNDLE_SUPPORT"] | |
dialog = ENV["DIALOG"] | |
gocode = ENV["TM_GOCODE"] | |
filepath = ENV["TM_FILEPATH"] | |
row = int(ENV["TM_LINE_NUMBER"]) | |
col = int(ENV["TM_LINE_INDEX"]) + 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
package main | |
import ( | |
"fmt" | |
) | |
type Celsius float64 | |
// Implement Stringer interface, used by %s in Printf | |
func (deg Celsius) String() string { |
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
class Settings : UITableViewController { | |
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { | |
let cell = tableView.cellForRowAtIndexPath(indexPath) | |
// The cells contentview is the one containing custom added components. | |
if let subviews = cell?.contentView.subviews { | |
// Find a subview which is a UITextField. Place cursor in this textfield. | |
for view in subviews { | |
if let textfield = view as? UITextField { |
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
for i in 1:length(M) | |
println(i) | |
end |
OlderNewer