Skip to content

Instantly share code, notes, and snippets.

// Given a function that accepts a callback with the functions response
// executes the function waiting for the callback, and setting `content`
// to the returned value before preceeding to the next item in the queue.
async: function(fun, callback) {
return this.then(function(content) {
var context = this;
this.wait();
fun(function(response) {
context.next(response);
});
async: function(fun, callback) {
return this.then(function(content) {
var context = this;
this.wait();
fun(function(response) {
context.next(response);
});
return false;
}).then(callback);
@quirkey
quirkey / lol
Created September 3, 2010 01:07
#!/usr/bin/env ruby
require 'open-uri'
category = ARGV[0] || 'fail'
url = "http://api.cheezburger.com/xml/category/#{category}/lol/random"
open(url) do |f|
xml = f.read
if xml =~ /LolImageUrl\>([^\<]*)/m
var fixHeaders = function(headers) {
var new_headers = {};
for (key in headers) {
var new_key = key.replace(/((^|\-)[a-z])/ig, function($1) {
return $1.toUpperCase();
});
new_headers[new_key] = headers[key];
};
return new_headers;
};
module Searchable
def self.searchable_fields
[]
end
def self.included(klass)
klass.named_scope :by_search, lambda {|q, options|
if q.present?
search_text = [klass.searchable_fields].flatten.collect {|f|
We couldn’t find that file to show.
# Resque::Reattempt
#
# The simplest auto-retry on failure (ala DJ) for Resque
#
# Just extend your job with the module and then instead of defining perform,
# define `perform_with_reattempt`:
#
# class MyReattemptJob
# extend Resque::Reattempt
#
We couldn’t find that file to show.

Hello How are you today, I hope all is well with you .I am sorry to worry you with my proposal for a relationship with you, but I know that you will grant my request in good faith and understanding, My name is Tessy I just went through your profile today at (github.com) and i have no options than letting you know that i am interested in having a relationship with you, I will also like to Know you the more, you can send an email to my email address so that I can send you more details about my self including my picture. I believe we can move from here. But bear in mind that love has no colors barrier, no educational back ground barrier, no socio-economic barrier, religious, language, nationality or distance barrier, the only important thing there is love. I am waiting for your mail to my email address above. Yours sincerely.

Tessy,