Skip to content

Instantly share code, notes, and snippets.

@jmonegro
jmonegro / forkfight_#6.md
Created February 10, 2014 16:35
Lorem ipsum

Find a more efficient way of calculating the ranking of an entry within 10,000 entries

Gistidify

My name is awesomeJoel and I created forkfight.

@jmonegro
jmonegro / forkfight.md
Created February 10, 2014 00:41
Boombox

Hello

@jmonegro
jmonegro / file1.txt
Created February 10, 2014 00:39
Gistify
String file contents
@jmonegro
jmonegro / bubble.css
Created February 9, 2014 23:41
Testing
h1 { font-family: 'Proxima Nova'; }
class NSObject
def method_missing(meth, *args)
obj_c_meth = meth.split('_').inject([]){ |buffer,e| buffer.push(buffer.empty? ? e : e.capitalize) }.join
if respond_to?(obj_c_meth)
send obj_c_meth, *args
else
raise NoMethodError.new(meth.to_s)
end
end
end
#!/usr/bin/env ruby
#
# Proof-of-Concept exploit for Rails DoS (CVE-2013-0156)
#
# ## Advisory
#
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion
#
# ## Synopsis
#
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@jmonegro
jmonegro / node-and-npm-in-30-seconds.sh
Created October 15, 2011 06:24 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
C:\Users\Joel\Desktop\current\2.remindery\app>ruby app.rb
C:/Ruby19/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/associations/relat
ionship.rb:616:in `cmp_model?': undefined method `base_model' for User:Class (No
MethodError)
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/assoc
iations/relationship.rb:555:in `inverse?'
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/assoc
iations/relationship.rb:394:in `block in inverse'
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/assoc
iations/relationship.rb:394:in `each'