Skip to content

Instantly share code, notes, and snippets.

Michael Granger ged

Block or report user

Report or block ged

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ged / app.html
Last active Jul 8, 2016 — forked from jdanyow/app.html
I'm Not Repeat.foring Correctly?
View app.html
<h1>I expect:</h1>
<strong>this</strong>: that<br>
<strong>those</strong>: these<br>
<h1>But I get:</h1>
<div repeat.for="[a,b] of stuff">
<strong>${a}</strong>: ${b}<br>

Keybase proof

I hereby claim:

  • I am ged on github.
  • I am ged ( on keybase.
  • I have a public key ASCwVmGyGLRuwjCKt6kSJ0Zy89VDirUXsa8kR8v84mDYggo

To claim this, I am signing this object:

View Add "strict attribute" mode for testing templates
diff --git a/lib/inversion/template.rb b/lib/inversion/template.rb
--- a/lib/inversion/template.rb
+++ b/lib/inversion/template.rb
@@ -121,6 +121,7 @@ class Inversion::Template
:ignore_unknown_tags => true,
:template_paths => [],
:stat_delay => 0,
+ :strict_attributes => false,
# Rendering options
ged / show.html.erb
Created Jan 19, 2012 — forked from pbruna/show.html.erb
Treequel adding to many extensions
View show.html.erb
class OrganizationalUnitsController < ApplicationController
def show
@organizational_unit = params[:id], :base )
require 'treequel/model'
require 'treequel/model/objectclass'
ged / sheen.rb
Created Oct 25, 2011 — forked from tarcieri/sheen.rb
Example class using Celluloid::Actor
View sheen.rb
class Sheen
include Celluloid::Actor
def initialize(name)
@name = name
def current_status
"#{@name} is winning!"
View modinheritance.rb
#!/usr/bin/env ruby
class A
def initialize
puts "Initializing an A"
module B
ged / parasite.rb
Created Nov 13, 2010
More cool/stupid Method#to_proc tricks
View parasite.rb
#!/usr/bin/env ruby -wKU
### A parasitic class
class Parasite
### Make all future instances of the Parasite actually call
### methods of the +victim+ instead.
def self.infest( victim )
victim.methods.each do |m|
meth = victim.method( m )
ged / copyfrom.rb
Created Sep 28, 2010
Example of how to use COPY FROM from Ruby with the 'pg' library. The last two edits are demonstrating the error case and the successful case.
View copyfrom.rb
#!/usr/bin/env ruby
require 'pg'
require 'stringio'
$stderr.puts "Opening database connection ..."
conn = PGconn.connect( :dbname => 'test' )
conn.exec( <<END_SQL )
View gist:77645
#!/usr/bin/env ruby
class A
def a; end
def b; end
class B < A
def a; end
You can’t perform that action at this time.