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
| """ | |
| Source, unknown. | |
| Tweaked by Daniel Von Fange. | |
| """ | |
| import sys | |
| import tempfile | |
| import hotshot | |
| import hotshot.stats |
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 'rubygems' | |
| require 'aws-sdk' | |
| # Change this stuff. | |
| AWS.config({ | |
| :access_key_id => 'YOURS_HERE', | |
| :secret_access_key => 'YOURS_HERE', | |
| }) | |
| bucket_name = 'YOUR_BUCKET_NAME' |
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
| ; Solving the Teleprompter coding kata in clojure | |
| ; (http://codingkata.org/katas/unit/teleprompter) | |
| (defn de-slang [text dictionary] | |
| (->> | |
| (.split text "\\$") | |
| (map (fn [word] [(str "\\$" word "\\$") (get dictionary word)])) | |
| (filter (fn [word_set] (last word_set)) ) | |
| (reduce (fn [str, word_set] (.replaceAll str (first word_set) (last word_set))) text)) ) |
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
| import random | |
| """ | |
| Written to simulate games using the 'likelihood of superiority' | |
| bayesian elo results dump from the conclusion of the 2010 Google AI challenge. | |
| -- Daniel Von Fange | |
| """ | |
| # We offset off this to find the scores |
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
| var config = { | |
| planet_font: 'bold 15px Arial,Helvetica ', | |
| planet_pixels: [10,13,18,21,23,29], | |
| display_size: 640, | |
| display_margin: 50, | |
| framerate: 5 | |
| } | |
| // Setup Context |
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
| diff --git a/docco.coffee b/docco.coffee | |
| index beb6ec7..399fe80 100644 | |
| --- a/docco.coffee | |
| +++ b/docco.coffee | |
| @@ -25,11 +25,11 @@ | |
| # and merging them into an HTML template. | |
| generate_documentation: (source) -> | |
| ensure_directory -> | |
| - set_language source | |
| code: fs.readFile source, (error, code) -> |
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 suds.client import Client | |
| URL = 'https://ws.customertest.newdea.com/NonprofitServices_100.asmx?wsdl' | |
| LOGIN = '' | |
| PASSWORD = '' | |
| ORGXID = '' | |
| client = Client(URL, timeout=600) |
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
| // PHP template engine for emailing form results. | |
| class LionbackTemplate{ | |
| function LionbackTemplate($template,$data){ | |
| $this->template=$template; | |
| $this->data=$data; | |
| } | |
| function render(){ |
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
| <? | |
| // Written for my own use, 2009 | |
| function select_exisiting_or_new($object,$field_name){ | |
| // To use: | |
| // echo select_exisiting_or_new($product,'manufacturer')? | |
| $current_value = $object->$field_name; | |
| $possible_values = $object->query("SELECT `$field_name` from $object->table_name GROUP BY `$field_name` ORDER BY `$field_name`"); |
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
| //in public void Update() | |
| //change | |
| if (updateResult.Errors) { throw new CouldNotUploadBudget(); } | |
| //to | |
| if (updateResult.Errors) { throw new CouldNotUploadBudget( this, updateResult); } | |
| //change | |
| public class CouldNotUploadBudget : System.Exception { } | |
| //to | |
| public class CouldNotUploadBudget : System.Exception { |