This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def on_unsubscribe(incoming) | |
@payload = incoming.payload | |
# puts fired_at | |
# puts action | |
# puts reason | |
# puts id | |
# puts list_id | |
# puts email | |
# puts email_type | |
# puts payload_with_email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git-ls-files --others --exclude-from=.git/info/exclude | |
# Lines that start with '#' are comments. | |
# For a project mostly in C, the following would be a good set of | |
# exclude patterns (uncomment them if you want to use them): | |
# *.[oa] | |
# *~ | |
* | |
.* | |
!.autotest | |
!.bash_aliases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'autotest/redgreen' | |
require 'autotest/timestamp' | |
module Autotest::Naughty | |
def self.naughty_notify title, text | |
system "echo \"naughty.notify({title='#{title}', text='#{text}', timeout=10})\" | awesome-client -" | |
end | |
Autotest.add_hook :red do |at| | |
errors = at.files_to_test.map { |k, v| "#{k}:\n #{v.join("\n ")}"}.join("\n\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
HOST=cdmwebs.homedns.org | |
SOURCE=/Users/chris | |
INCLUDE=/Users/chris/bin/include.txt | |
PATHTOBACKUP=/media/storage/backups/panthera | |
PID=`pidof -s /bin/sh /Users/chris/bin/time_machine.sh` | |
# No more changes. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
module ValidatedAccessor | |
# Usage: | |
# | |
# class Foo | |
# include ValidatedAccessor | |
# attr_validated_accessor(:bar, :baz) { |x| x.between? 1, 10 } | |
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Things to do on Zoidberg day: | |
- Apply for those mail-order degrees in murderology and murderometry that you've | |
always wanted. | |
- Go hunting for guinea pigs. | |
- Put on your formal shell and have a fancy party. | |
- Experiment with bodily secretions-as-jewelry. It could be a big hit! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## What I'm talking about. | |
class TestClass | |
# calling instance methods (public or private) works just fine | |
# if you don't use an explicit self. | |
def this_method_works_fine | |
foo | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
duwanis@localhost ~ $ jirb | |
irb(main):001:0> JString = java.lang.String | |
=> Java::JavaLang::String | |
irb(main):002:0> class JString | |
irb(main):003:1> def is_monkeypatched? | |
irb(main):004:2> return true | |
irb(main):005:2> end | |
irb(main):006:1> end | |
=> nil | |
irb(main):007:0> x = java.lang.String.new("Testing.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If I were, say, working on a Swing app in JRuby | |
# This is code I'd love to be able to write... | |
main_window.ok_button.when_clicked do |event| | |
if validate_form | |
controller.submit_form (form_data) | |
else | |
display_error_messages | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Parent | |
def foo | |
puts "I'm a good parent." | |
end | |
end | |
module Interloper | |
def foo | |
puts "I've got candy in the van." | |
end |
OlderNewer