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
<% | |
def html = new URL("http://www.gifbin.com/random").getText() | |
def images = html =~ /img src=['"](http:\/[^"']*\.gif)['"]/ | |
def gif = images.collect { it[1] }[0] | |
if (gif != null) { | |
%> | |
<img src="<%= gif %>"/> | |
<% } %> |
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
import com.almworks.sqlite4java.SQLiteConnection; | |
import com.almworks.sqlite4java.SQLiteException; | |
import com.almworks.sqlite4java.SQLiteStatement; | |
import de.tudarmstadt.ukp.jwktl.api.IWiktionaryEntry; | |
import de.tudarmstadt.ukp.jwktl.api.IWiktionarySense; | |
import de.tudarmstadt.ukp.jwktl.api.WiktionaryException; | |
import de.tudarmstadt.ukp.jwktl.api.entry.WiktionaryEntry; | |
import de.tudarmstadt.ukp.jwktl.api.entry.WiktionaryPage; | |
import de.tudarmstadt.ukp.jwktl.api.util.ILanguage; | |
import de.tudarmstadt.ukp.jwktl.parser.util.IDumpInfo; |
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 | |
#based on /usr/share/doc/git-core/contrib/hooks/post-receive-email | |
require 'syslog' | |
MARLEY_DIR="/home/git/marley" | |
def log(msg) | |
Syslog.open | |
Syslog.debug(msg) |
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
# .irbrc | |
# vim: set syntax=ruby : | |
require 'irb/completion' | |
require 'irb/ext/save-history' | |
require 'fileutils' | |
require 'pp' | |
require 'rubygems' | |
ARGV.concat [ "--readline", | |
"--prompt-mode", |
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
# ------------------------------------------------------------------------------ | |
# SCREEN SETTINGS | |
# ------------------------------------------------------------------------------ | |
startup_message off | |
#defflow on # will force screen to process ^S/^Q | |
deflogin on | |
#autodetach off |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
export PS1="\[\e[1;36m\]\h:\w\[\e[0m\] \$(parse_git_branch) \$ " |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
export PS1="\[\e[1;36m\]\h:\w\[\e[0m\] \$(parse_git_branch) \$ " |
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 macruby | |
require 'hotcocoa' | |
include HotCocoa | |
NORMAL_OUTPUT_DEVICE = "Built-in Output" | |
DUMMY_OUTPUT_DEVICE = "Soundflower (2ch)" | |
def set_output_device(device) | |
`AudioSwitcher -t output -s '#{device}'` |
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 'ffi' | |
module Exec | |
extend FFI::Library | |
attach_function :my_exec, :execl, [:string, :string, :varargs], :int | |
attach_function :fork, [], :int | |
end | |
vim1 = '/usr/bin/vim' |
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
curl -s http://aserver.com/path/file.csv | ruby -rcsv -e 'puts CSV.parse($stdin.read).map { |a,b| "#{a}\t#{b}" }.join("\n")' | pbcopy |
OlderNewer