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
from unittest import TestCase, main | |
import re | |
class WordList(object): | |
def __init__(self, unsorted_words): | |
self.unsorted_words = unsorted_words | |
def unsorted(self): | |
return self.unsorted_words |
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
## shared connections from profile search result | |
profile.relation_to_viewer["relation-to-viewer"]. | |
gsub(/\n/,''). | |
scan(/(\s[a-zA-Z]+\s+[a-zA-Z]+)/).each do |n| | |
p n.to_s.strip.gsub(/\s+/, ' ') | |
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
Ruby 1.9.0.0 compile error (openssl problem) | |
TAGS: None | |
Found these error: | |
view sourceprint? | |
compiling openssl | |
gcc -I. -I../../.ext/include/i686-darwin10.2.0 -I../.././include -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\" -fno-common -g -O2 -pipe -fno-common -o openssl_missing.o -c openssl_missing.c | |
In file included from openssl_missing.c:22: |
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
export PS1='[\W `~/.rvm/bin/rvm-prompt v p g ` `git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\[\033[1\;32m\]\(\\\\\1\)\/`\[\033[37m\]]$\[\033[00m\] ' |
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
env ARCHFLAGS="-arch i386" gem install mysql -- \ | |
--with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \ | |
--with-mysql-include=/usr/local/mysql/include |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>com.mysql.mysqld</string> | |
<key>ProgramArguments</key> | |
<array> |
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
export PS1='[\W `~/.rvm/bin/rvm-prompt v p g ` `git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\[\033[1\;32m\]\(\\\\\1\)\/`\[\033[37m\]]$\[\033[00m\] ' |
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 NotANumberException < StandardError | |
end | |
class FizzBuzz | |
def initialize(numero) | |
raise NotANumberException unless numero.is_a? Integer | |
@numero = numero | |
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
function round(a, b) { | |
if (arguments.length != 2){ | |
return "fail"; | |
} | |
var matrix = { | |
paper:{winsAgainst:"rock"}, | |
rock:{winsAgainst:"scissors"}, | |
scissors:{winsAgainst:"paper"} | |
} | |
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
url = "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=mofouser&api_key=mofoapikey" | |
resp = HTTParty::get(url) | |
p resp.parsed_response["lfm"]["recenttracks"]["track"].first {|t| t["nowplaying"] == "true" } |