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
| func setupAndRunViper(path, format string, viperCh) { | |
| sigCh := make(chan os.Signal, 1) | |
| signal.Notify(sigCh, syscall.SIGHUP) | |
| cnt := 0 | |
| for { | |
| v := viper.New() | |
| v.SetConfigFile(path) | |
| v.SetConfigType(format) | |
| var err error |
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
| from ujson import dumps | |
| import pprint | |
| class Test: | |
| def __init__(self): | |
| self.data = "foobar" | |
| self._data = "barfoo" | |
| class Test2(Test): | |
| def toDict(self): |
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
| URLS="https://raw.github.com/git/git/master/contrib/completion/git-completion.bash https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh" | |
| DONE=0 | |
| which "wget" >> /dev/null | |
| if [ $? -eq 0 ]; then | |
| for url in $URLS; do | |
| OUT=$(echo $url | cut -f9 -s -d/) | |
| wget $url -q -O ~/.$OUT | |
| done | |
| DONE=1 | |
| fi |
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 match: | |
| has_many :match_maps | |
| has_many :maps, :through => :match_maps, :conditions => {'match_maps.veto' => false}, :source => :map, :class_name => "Map" | |
| has_many :vetos, :through => :match_maps, :conditions => { 'match_maps.veto' => true}, :source => :map, :class_name => "Map" | |
| m = Match.find(1) | |
| m.vetos << Map.find(1) | |
| m.map << Map.find(2) |
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"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>DVTConsoleDebuggerInputTextColor</key> | |
| <string>0 0 0 1</string> | |
| <key>DVTConsoleDebuggerInputTextFont</key> | |
| <string>Menlo-Bold - 11.0</string> | |
| <key>DVTConsoleDebuggerOutputTextColor</key> | |
| <string>0 0 0 1</string> |
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
| """ | |
| Script to convert a Xcode3 Color theme into a Xcode4 one. | |
| Example: | |
| bash# python xcode3_theme_to_xcode4.py Twilight.xcolortheme | |
| It will write a new file: Twilight.dvtcolortheme into the same folder as the script is residing in. | |
| """ | |
| import plistlib,sys | |
| """ Define boilerplate of the color theme """ | |
| defaultConfig = { |
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
| function get_latest_html() | |
| { | |
| URL=$1 | |
| PATTERN=$2 | |
| TYPE=$3 | |
| LATEST=`curl -s ${URL} | egrep -o '<a href="([^\"]+)"' | awk -F\" '{print $2 }' | egrep ${PATTERN} | egrep ${TYPE} | egrep -v '(diff|sig)' | sort -nr | head -n1` | |
| curl -s "${URL}/${LATEST}" | |
| } | |
| function get_latest_text() |