- Involve a different sense - draw it, or hand-wave it
- Ask your question of a duck
- Type your question out in a forum or chatroom
- Validate your assumptions - what have you mis-taken for granted ?
- Break it to learn: "If I break it this way, I expect it to do X"
- Step away from it, activate your other senses
- Resort to a cheat, clearly labeling it as HACK, and return right after the next problem
- Look at the order in which you do things
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
# Alternative to add_column that will do nothing if a column by that name exists already | |
# Ensures a column of the name will exist - either creating it or leaving the existing one be | |
# Looks up the table_name in AR::Base's descendants to query them whether this column exists (by name) yet | |
# Currently does not ensure that the options for the column are the same, nor ensure all models are loaded | |
def self.ensure_column tn, cn, *opts | |
klass = begin | |
@@tables_to_classes ||= | |
ActiveRecord::Base.class_eval{ subclasses }.inject({}) do |map, this_class| | |
map[this_class.table_name] = this_class | |
map |
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
# MY FIRST (NON-WORKING) ATTEMPT - borrowing from rails/lib/console_sanbox.. | |
# I think it works only for console where a single connection can be counted on | |
# Allow for server to run in a mode where xactions are rolled back on exit, | |
# like script/console's --sandbox option. eg: > SANDBOX=1 script/server -p 3001 | |
if ENV['SANDBOX']=="1" | |
$stderr.puts "NOTE: YOU ARE RUNNING IN SANDBOX MODE, ALL XACTIONS WILL ABORT ON EXIT" | |
conf = YAML::load( File.open(RAILS_ROOT + '/config/database.yml'))[RAILS_ENV] | |
$stderr.puts conf.inspect | |
ActiveRecord::Base.establish_connection(conf) |
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
memoizer = {}; | |
function memosin(arg){ | |
if( memoizer[arg] ){ | |
return memoizer[arg] | |
} | |
else{ | |
memoizer[arg] = mysin(arg) | |
return memoizer[arg] | |
} |
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
hihat:clojure_1 $> lein repl | |
Exception in thread "main" java.lang.ClassNotFoundException: clojure.main | |
at java.net.URLClassLoader$1.run(URLClassLoader.java:202) | |
at java.security.AccessController.doPrivileged(Native Method) | |
at java.net.URLClassLoader.findClass(URLClassLoader.java:190) | |
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229) | |
at java.lang.ClassLoader.loadClass(ClassLoader.java:307) | |
at java.lang.ClassLoader.loadClass(ClassLoader.java:248) | |
at java.lang.Class.forName0(Native Method) |
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
find . -mtime 1 # sort by modified time |
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
<!DOCTYPE html> | |
</html> | |
<head> | |
<title>Jasmine Test Suite for Player-to-Player Chess</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="//searls.github.io/jasmine-all/jasmine-all-min.js"></script> | |
<!-- script type="text/javascript" src="/js/jasmine-all-min.js"></script --> | |
<script type="text/javascript"> | |
describe("Positions Vectors and Sides, oh my", function(){ |
Node 2 hour course
Agenda
- 0:00 - 0:05 Course Outline
- 0:05 - 0:30 Discussion - What Is Node, Really ?
- 0:30 - 0:55 Micro-challenges and review
- 0:55 - 1:00 Break
- 1:00 - 1:50 Labs - Learnyounode
- 1:50 - 2:00 Review
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
http://prezi.com/tnrx86yhlzll/git-happens-2-kcdc/ |
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
// JS.Chi Explanation of Kangax Javascript Quiz problem #7 about the binding rules for 'this' | |
// Dean Radcliffe, Deanius Solutions, Inc. | |
// www.deanius.com | |
// Presenter Setup: Split-screen browser/sublime, using JsRun to execute in chunks | |
console.clear(); | |
/************** SEEING IT *****************/ |
OlderNewer