Skip to content

Instantly share code, notes, and snippets.

View sd's full-sized avatar
🫓
eating arepas

Sebastian Delmont sd

🫓
eating arepas
View GitHub Profile
@sd
sd / chunky_find.rb
Created December 4, 2008 14:57
acts_as_streeteasy's chunky_find
#==============================================================================
# It's nice to have an easy way to iterate over model objects without having
# to load them all in memory at once.
class ActiveRecord::Base
def self.chunky_find(args = {}, &block)
reporter = args.delete(:reporter)
reporter = nil unless reporter and reporter.respond_to? :call
sleep_duration = args[:sleep]
args.delete(:sleep)
if [ "$SSH_TTY" ]; then
# If this is a remote session, then start screen
if [ "$TERM" != "screen" ]; then
screen -xRRU
if [ "$?" = "0" ]; then
reset
exit
fi
fi
fi
EARTH_RADIUS = {
:miles => 3_963.189,
:km => 6_378.135
}
units_per_lat = 2.0 * Math::PI * EARTH_RADIUS[units] / 360.0
units_per_lon = units_per_lat * Math.cos(Math::PI * longitude.to_f / 360.0).abs
class SEShake < Poundie::Plugin
register :se_shake
match do |message|
message.body =~ /(^\!shake|shakeshack|shake shack)/i and message.body !~ /camera\.jpg/
end
action do |message|
speak "http://www.shakeshack.com/camera.jpg"
end
@sd
sd / shit_talk.coffee
Created October 26, 2011 15:58 — forked from psi/shit_talk.coffee
Make Hubot talk shit.
# Make Hubot talk shit.
module.exports = (robot) ->
robot.hear /(fuck you|fuck off|shut up)/i, (msg) ->
incoming_msg = msg.message
if incoming_msg.text.match ///#{robot.name}///i
diss = msg.match[1]
if diss != "fuck you"
function bundle_exec {
if [[ -a Gemfile ]]; then
bundle exec $*
else
$*
fi
}
alias rake="bundle_exec rake"
alias cap="bundle_exec cap"
@sd
sd / ponche-crema-receta.markdown
Last active February 18, 2024 21:08 — forked from anibal/ponche-crema-receta.markdown
Granny's Carúpano Style Egg Nog (Ponche Crema Carupanero)

Granny's Carúpano Style Egg Nog (Ponche Crema Carupanero)

Ingredients

  • 1 bottle of Whistle Pig bourbon whiskey (or rye), 1 bottle of Bruichladdich scotch whisky
  • 30 egg yolks
  • 4 cans of condensed milk (14 oz / 397g per can)
  • 1 bottle of rum (750 ml)
x = "123"
case x
when /\d+/
...
when String
...
when 1..3
...
when "123"
...
@sd
sd / gist:4186998
Created December 2, 2012 04:40
Pan de Jamón a la Echeverría

Pan de Jamón (a la Echeverría)

Masa

  • 1 taza de leche tibia
  • 1 sobrecito de levadura (Fleishmann ActiveDry Yeast) Esperar 10 minutos a ver si la levadura levanta