Skip to content

Instantly share code, notes, and snippets.

View RogerPodacter's full-sized avatar
🎯
Focusing

Tom Lehman RogerPodacter

🎯
Focusing
View GitHub Profile
if (!window.VINE_EMBEDS) {
window.VINE_EMBEDS = true;
window.VINE_DEBUG = [];
function hasClass(element, className) {
return element.className.match(new RegExp('(\\s|^)' + className + '(\\s|$)'));
}
function addClass(element, className) {
if (!this.hasClass(element, className)) element.className += " " + className;
# Take a positive integer, like 9, and apply the following rule. If it’s odd, multiply it by 3 and add 1; if it’s even, divide it in half. 9 -> 28 -> 14 -> 7 -> 22 -> 11... The Collatz conjecture says that all such chains will terminate in the 1 -> 4 -> 2 -> 1 -> 4... loop. Calling “1” the end of a chain, for what integer less than a million is the Collatz chain the longest?
require 'active_support'
extend ActiveSupport::Memoizable
def apply_collatz_rule(num)
if num % 2 == 0
num / 2
else
num * 3 + 1
<a href="#" class="state-accepted" data-id="317062">[Intro: Blades of Glory sample]</a>
<a href="#" class="state-accepted" data-id="449228">We're going to skate to one song, one song only</a>
<a href="#" class="state-accepted" data-id="422834">[Verse 1: Jay-Z]</a>
<a href="#" class="state-accepted" data-id="312661">So I ball so hard mothafuckas wanna fine me, first niggas gotta find me
What's 50 grand to a mothafucka like me, can you please remind me</a>
<a href="#" class="state-accepted" data-id="329412">(Ball so hard) This shit crazy, y'all don't know that don't shit faze me</a>
<a href="#" class="state-accepted" data-id="312659">The Nets could go 0 for 82 and I'd look at you like this shit gravy</a>
<a href="#" class="state-accepted" data-id="313354">(Ball so hard) This shit weird,</a> <a href="#" class="state-accepted" data-id="313107">we ain't even spose to be here</a>
<a href="#" class="state-accepted" data-id="407802">(Ball so hard)</a> <a href="#" class="state-accepted" data-id="398852">Since we here
module Dalli
class Client
def perform_with_hash(op, key, *args)
perform_without_hash(op, Digest::SHA1.hexdigest(key), *args)
end
alias_method_chain :perform, :hash
end
end
$(window).load(function() {
$('.lyrics a.has_verified_annotation').each(function(i){
$(this).append('<div class="verified_line_checky"></div>');
});
})
~/rails_apps/rapgenius >: rvm info
/Users/tom/.rvm/bin/gem: line 5: /Users/tom/.rvm/bin/gem: Argument list too long
/Users/tom/.rvm/bin/gem: line 5: /Users/tom/.rvm/bin/gem: Unknown error: 0
system:
system:
uname: "Darwin tom-mbp.home 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
2011-04-26T05:59:04+00:00 app[web.5]: Parameters: {"referent"=>"Keep on... a' to the breakadawn", "song_slug"=>"Rhymes-like-dimes", "action"=>"new", "lyric_slug"=>"keep-on-a-to-the-breakadawn", "artist_slug"=>"Mf-doom-ft-dj-cucumber-slice", "controller"=>"annotations"}
2011-04-25T22:59:05-07:00 heroku[nginx]: GET /lyrics/Crooked-i/Black-and-yellow-freestyle-hhwr-13 HTTP/1.1 | 110.32.29.112 | 0 | http | 499
2011-04-26T05:59:05+00:00 heroku[router]: Error H12 (Request timeout) -> GET rapgenius.com/posts.atom dyno=web.6 queue=0 wait=0ms service=0ms bytes=0
2011-04-26T05:59:05+00:00 app[web.5]: Rendering template within layouts/minimal
2011-04-26T05:59:05+00:00 app[web.5]: Rendering annotations/new
2011-04-26T05:59:05+00:00 app[web.5]: Completed in 387ms (View: 72, DB: 305) | 200 OK [http://rapgenius.com/lyrics/Mf-doom-ft-dj-cucumber-slice/Rhymes-like-dimes/keep-on-a-to-the-breakadawn?referent=Keep%20on...%20a'%20to%20the%20breakadawn]
2011-04-26T05:59:05+00:00 app[web.5]:
2011-04-26T05:59:05+00:00 app[web.5]:
dj empirical 12904232502097772955
billtron 11960633949492023380
Sawyer Carter Jacobs 02606413893553028032
Evan Carmouche 15932439420494476147
Kate Burns 17535307611545811967
s.gsub(/^.{1,5}$/, '').gsub(/^[ ~-]+$/, '').gsub(/^[^a-zA-Z]+$/, '').gsub(/^\s*INSIDE THE THIRD REICH\s*$/, '').rg_markdown_to_html.to_file("third.html")
@RogerPodacter
RogerPodacter / heroku_bundler_downloader.rb
Created February 16, 2011 17:45
Heroku Bundler Downloader
app_name = "YOUR_APP_NAME"
bundles = `heroku bundles`.split("\n")
bundles.select{|i| i.match(/\d{4}-\d{2}-\d{2}\s+c/)}.each do |bundle|
name = bundle.split.first
puts "downloading #{name}"
system("heroku bundles:download #{name}")
system("mv #{app_name}.tar.gz #{name}-rapgenius.tar.gz")
puts "done!\n\n"
end