This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
def delete_failed_job_if | |
redis = Resque.redis | |
(0...Resque::Failure.count).each do |i| | |
string = redis.lindex(:failed, i) | |
break if string.nil? | |
job = Resque.decode(string) | |
should_delete_job = yield job | |
next unless should_delete_job |
has_many :child_connections, :class_name => 'Connection', :foreign_key => 'from_id' | |
has_many :parent_connections, :class_name => 'Connection', :foreign_key => 'to_id', :dependent => :destroy | |
has_many :children, :through => :child_connections, :source => :to | |
has_many :parents, :through => :parent_connections, :source => :from |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/usr/bin/env python | |
""" | |
fabfile.py | |
Copyright (c) 2011 Giovanni Collazo | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
require 'rubygems' | |
require 'rack' | |
class Object | |
def webapp | |
class << self | |
define_method :call do |env| | |
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
[200, {}, send(func, *attrs)] | |
end |
/* | |
Add a bookmark to this | |
javascript:(function(){var c=document.getElementsByTagName("link");for(var d=0;d<c.length;d++){var a=c[d];if(a.type=="text/css"){var e="css_buster_"+Math.floor(Math.random()*1000000000);var g=a.href.split("?",1);var f;if(g.length>1){var b=g[1].indexOf("&")==-1;if(b){f=e}else{f=g[1]+"&"+e}}else{f=e}a.href=g[0]+"?"+f}}})(); | |
*/ | |
(function() { | |
var links = document.getElementsByTagName('link'); | |
for (var i = 0; i < links.length; i++) { | |
var l = links[i]; | |
if (l.type == 'text/css') { |
This is the latest version of an email which I send periodically, offering customers the opportunity to pre-pay for SaaS in return for a discount. The benefits to the SaaS company are better cash flow and reduced churn rate. The benefits to the customer are, well, in the email. This genre of email has produced hundreds of thousands of dollars in pre-pays for some companies I work with, and it rarely requires any more work than this example.
I've put $79 is as a placeholder for the cost of the user's plan. We calculate that for each account, naturally, along with the billing contact's name.
Subject: Save $79 on Appointment Reminder (and get a tax write-off) Formatting: 100% plain text. Gmail automatically links up the central link. From: Patrick McKenzie (Appointment Reminder) patrick@appointmentreminder.org