Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
module DeepFetch | |
def deep_fetch(*keys, &fetch_default) | |
throw_fetch_default = fetch_default && lambda {|key, coll| | |
args = [key, coll] | |
# only provide extra block args if requested | |
args = args.slice(0, fetch_default.arity) if fetch_default.arity >= 0 | |
# If we need the default, we need to stop processing the loop immediately | |
throw :df_value, fetch_default.call(*args) | |
} | |
catch(:df_value){ |
eXtreme Go Horse (XGH) Process | |
Quelle: http://gohorseprocess.wordpress.com | |
Übersetzung ursprünglich von https://gist.github.com/Neffez/f8d907ba8289f14e23f3855011fa4e2f | |
1. Ich denke, also ist es nicht XGH. | |
In XGH wird nicht gedacht, es wird das erste gemacht, was in den Sinn kommt. Es gibt auch keine zweite Option, die erste ist schneller. | |
2. Es gibt 3 Wege ein Problem zu lösen: den richtigen Weg, den falschen Weg und den XGH Weg, welcher exakt wie der falsche ist, aber schneller. |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
// Turtle Graphics in Processing | |
// Natalie Freed, February 2013 | |
// This program shows another way to think about moving | |
// through Processing's coordinate system. Instead of placing | |
// points on a grid, you can imagine yourself as being somewhere | |
// on the grid, facing a direction. You can move forward or turn. | |
// The drawn line follows behind you. | |
PVector loc; //current location | |
float orientation; //current orientation |
require "spec_helper" | |
describe ExampleController do | |
context "GET #index" do | |
let(:resources) { FactoryGirl.create_list(:resource) } | |
before do | |
get :index | |
end |
The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.
class Turtle { | |
float x = 0; | |
float y = 0; | |
float dir = 0; | |
boolean pen_down = false; | |
int weight = 1; | |
color pen_color = #000000; | |
Turtle(float x, float y, float dir) { | |
this.x = x; |
import turtle | |
def turn(i): | |
left = (((i & -i) << 1) & i) != 0 | |
return 'L' if left else 'R' | |
def curve(iteration): | |
return ''.join([turn(i + 1) for i in range(2 ** iteration - 1)]) | |
if __name__ == '__main__': |