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
| require 'fuzzy_match' | |
| require 'amatch' | |
| require 'text' | |
| class Completion | |
| attr_accessor :keywords | |
| def initialize( keywords=[] ) | |
| self.keywords = keywords.map(&:downcase) | |
| ambiguous = true |
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
| TMPFILE=".$(uuidgen).tmp.rb" | |
| cat > $TMPFILE <<RUBYSCRIPT | |
| # TODO: replace this with real code | |
| puts "Running Ruby #{RUBY_VERSION}" | |
| puts "Arguments are #{ARGV.inspect}" | |
| RUBYSCRIPT | |
| /usr/bin/env ruby $TMPFILE "{query}" | |
| rm $TMPFILE |
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
| @interface NSData (CRC32) | |
| -(NSUInteger) crc32; | |
| @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
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/3112090/hack.sh | sh | |
| # |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <item name="a"> | |
| <item name="d"> | |
| <item name="g"></item> | |
| </item> | |
| <item name="e"></item> | |
| <item name="f"></item> | |
| </item> | |
| <item name="b"></item> | |
| <item name="c"></item> |
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
| tty = STDIN.reopen('/dev/tty') | |
| tty.each_line do |line| | |
| break if line == "\n" | |
| puts line | |
| end | |
| tty.close |
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
| plot = Plot[Cos[x],{x,0,2\[Pi]}]; | |
| mydata = Flatten[Cases[plot, Line[x__] -> x, Infinity], 1]; | |
| Export["/Users/padde/Desktop/plot-data.dat", mydata, "CSV"]; |
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
| class Fixnum | |
| def each_bit | |
| 8.times do |p| | |
| yield (self & 1 << p) >> p | |
| end | |
| end | |
| 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
| ffmpeg -i INFILE -r 25 -f mpeg -vcodec mpeg1video -ar 48000 -b 1500k -acodec mp2 -ar 44100 -ac 1 -y OUTFILE.mpg |
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
| # your other stuff… | |
| # set ZSH_THEME above this line! | |
| # TODO: remove this when bug is fixed in oh-my-zsh | |
| # Workaround for loading theme from $ZSH_CUSTOM | |
| # Github issue: https://github.com/robbyrussell/oh-my-zsh/pull/1107 | |
| MY_ZSH_THEME=$ZSH_THEME; ZSH_THEME='' | |
| # OH MY ZSH! |