Skip to content

Instantly share code, notes, and snippets.

View ariejan's full-sized avatar

Ariejan de Vroom ariejan

View GitHub Profile
@ariejan
ariejan / Dog.java
Created March 1, 2013 14:03
Simple jUnit example for @avdgaag's TDD presentation.
public class Dog {
public String bark() {
return "WOOF!";
}
}
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src
let(:post) { create :post, body: "Blah en *narf*" }
it "let's Kramdown do the heavy lifting" do
kramdown = double
kramdown.should_receive(:to_html)
Kramdown::Document.should_receive(:new).with(post.body).and_return(kramdown)
helper.markdown(post.body)
end
@Override
public void render(float delta) {
// Clear screen
Gdx.gl20.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
Gdx.gl20.glClearColor(0f, 0f, 0.2f, 1f);
Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
// Set camera position
camera.position.set(new Vector3(player.getPosition().x, player.getPosition().y, 0));
camera.update();
@ariejan
ariejan / states.rb
Created May 13, 2013 08:37
States.
state_machine :state, initial: :concept do
state :concept
state :incomplete
state :complete
state :dismissed
event :cancel do
transition [:concept, :incomplete, :complete] => :dismissed
end
end
@ariejan
ariejan / todo.rb
Created May 16, 2013 12:15
A simple TODO app in Ruby.
#!/usr/bin/env ruby
# encoding: utf-8
{
"Write a todo app" => true,
"Create my first item" => true,
"Publish source code" => true,
"??" => false,
"Profit!" => false
}.each_pair {|d,s| puts "[#{s ? '✓' : ' '}] #{d}"}
@ariejan
ariejan / aliases
Created October 22, 2013 07:36
/etc/aliases example

Keybase proof

I hereby claim:

  • I am ariejan on github.
  • I am ariejan (https://keybase.io/ariejan) on keybase.
  • I have a public key whose fingerprint is 9733 0ED9 9A77 2FBB 866E C69C 2E3D 97A2 EBCA CF9A

To claim this, I am signing this object:

#############################################################################
##
## extended_gcd.rb
##
## given non-negative integers a > b, compute
## coefficients s, t such that gcd(a, b) == s*a + t*b
##
def extended_gcd(a, b)
# trivial case first: gcd(a, 0) == 1*a + 0*0
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="woman">Hello from GET ME OUT OF HERE. This your courtesy phone call to get you out of there. You have 10 seconds.</Say>
<Pause length="10" />
<Say voice="woman">This call will end now.</Say>
<Pause length="1" />
<Say voice="woman">Bye now.</Say>
<Hangup/>
</Response>