Skip to content

Instantly share code, notes, and snippets.

View bryanp's full-sized avatar

Bryan Powell bryanp

View GitHub Profile
@bryanp
bryanp / trace.txt
Created October 2, 2015 16:23
Celluloid 0.17.2 Segfault on Ruby 2.3.0-dev
/home/travis/.rvm/gems/ruby-head/gems/celluloid-0.17.2/lib/celluloid/system_events.rb:31: [BUG] Segmentation fault at 0x00000000000000
ruby 2.3.0dev (2015-10-02 trunk 52005) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0035 p:---- s:0120 e:000119 CFUNC :define_method
c:0034 p:0097 s:0116 e:000115 METHOD /home/travis/.rvm/gems/ruby-head/gems/celluloid-0.17.2/lib/celluloid/system_events.rb:31
c:0033 p:0036 s:0110 e:000109 CLASS /home/travis/.rvm/gems/ruby-head/gems/celluloid-0.17.2/lib/celluloid/system_events.rb:113
c:0032 p:0121 s:0108 e:000107 CLASS /home/travis/.rvm/gems/ruby-head/gems/celluloid-0.17.2/lib/celluloid/system_events.rb:106
c:0031 p:0009 s:0106 e:000105 TOP /home/travis/.rvm/gems/ruby-head/gems/celluloid-0.17.2/lib/celluloid/system_events.rb:1 [FINISH]
c:0030 p:---- s:0104 e:000103 CFUNC :require
c:0029 p:0315 s:0100 e:000099 TOP /home/travis/.rvm/gems/ruby-head/gems/celluloid-0.17.2/lib/celluloid.rb:476 [FINISH]
@bryanp
bryanp / logic.rb
Last active September 28, 2015 20:56
Pakyow 0.9 Empty View Version
# when data is an empty set, the empty version is used automatically
view.scope(:post).apply(data)
@bryanp
bryanp / links.md
Created July 23, 2015 13:31
HackHuntsville Pakyow Notes
@bryanp
bryanp / _results
Last active August 29, 2015 14:08
StringDoc Benchmark (Pakyow v0.9 + Ruby 2.1.2)
user system total real
rendering (Pakyow::Presenter::StringDoc)
0.300000 0.000000 0.300000 ( 0.314247)
rendering (Pakyow::Presenter::NokogiriDoc)
0.390000 0.000000 0.390000 ( 0.389738)
finding scope (Pakyow::Presenter::StringDoc)
1.400000 0.020000 1.420000 ( 1.418042)
@bryanp
bryanp / gist:049ec81eb8a4dd353f49
Last active August 29, 2015 14:08
WTF Keyword Args
class MM
def method_missing(method, *args, **kargs)
foo(*args)
end
end
def foo(data, one: 1)
end
MM.new.foo({ foo: 'bar' }, one: 1)
@bryanp
bryanp / gist:b729fb5e5674b5b5d374
Last active August 29, 2015 14:08
Perplexing Keyword Args
class MM
def method_missing(method, *args, **kargs)
puts method.inspect
puts args.inspect
puts kargs.inspect
end
end
MM.new.foo({ foo: 'bar' }, one: 1)
# => :foo
@bryanp
bryanp / gist:3f48b3dacb081b8865e2
Created October 13, 2014 22:57
Page Titles in Pakyow
---
title: some title
---
Your page content goes here.
---
template: foo
---
content here
@bryanp
bryanp / app.rb
Created August 20, 2014 12:29
Pakyow Hook Example
Pakyow::App.define do
after :init do
DataMapper.finalize
end
# ...
end
@bryanp
bryanp / pakyow-full.html
Last active August 29, 2015 14:02
Faster View Manip
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Pakyow - Ruby Web Framework</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" media="screen, projection" href="/stylesheets/screen.css">
<link rel="stylesheet" type="text/css" media="print" href="/stylesheets/print.css">
<link rel="shortcut icon" type="image/png" href="/favicon.png">