Skip to content

Instantly share code, notes, and snippets.

View phillmv's full-sized avatar
😅
test string here

Phill MV phillmv

😅
test string here
View GitHub Profile
@ctrochalakis
ctrochalakis / exception_notify_helper.rb
Created August 26, 2010 09:31
Using exception_notifier for rake tasks or scripts
# Exception notifier (rails3) only works as a rack middleware,
# but what if you need notifications inside a rake task or a script?
# This is a quick hack around that.
#
# Wrap your code inside an exception_notify block and you will be notified of exceptions
#
# exception_notify { clear_payments }
def exception_notify
yield
rescue Exception => exception
@aanand
aanand / gif
Created November 23, 2011 11:39
Command-line gif creator
#!/usr/bin/env ruby
require "optparse"
default_file_pattern = "png/*.png"
default_output_filename = "out.gif"
start = nil
finish = nil
skip = 1
@avdi
avdi / when.rb
Created December 5, 2011 22:17
Experimenting with Object#when in Ruby
def maybe_a_sandwich
nil
end
# Methods that might return nil are annoying. We want to write a nice
# confident chain:
result = nil
result = maybe_a_sandwich.add_horseradish.get_into_my_belly! rescue $!
result # => #<NoMethodError: undefined method `add_horseradish' for nil:NilClass>
@IanColdwater
IanColdwater / twittermute.txt
Last active November 17, 2024 02:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet