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 lookup_url(ident); "http://favstar.fm/users/#{ident}"; end | |
def save_result(ident, result); puts Hpricot(result).at(:title).inner_text; end | |
def logger; Rails.logger; end | |
def name; 'console'; end | |
include Point::SiteLookup | |
perform_lookup! 'samstokes' | |
# console is querying http://favstar.fm/users/samstokes | |
# @samstokes' (Sam Stokes) most faved tweets |
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
<?xml version='1.0' encoding='UTF-8'?> | |
<project> | |
<actions/> | |
<description>https://github.com/jenkinsci/rake-plugin/issues/3</description> | |
<keepDependencies>false</keepDependencies> | |
<properties> | |
<com.coravy.hudson.plugins.github.GithubProjectProperty> | |
<projectUrl>https://github.com/jenkinsci/rake-plugin/</projectUrl> | |
</com.coravy.hudson.plugins.github.GithubProjectProperty> | |
</properties> |
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
foo |
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
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb | |
index b811e60..34323e3 100644 | |
--- a/app/controllers/application_controller.rb | |
+++ b/app/controllers/application_controller.rb | |
@@ -33,6 +33,38 @@ class ApplicationController < ActionController::Base | |
protected | |
+ # ActionController::Base calls this before processing each controller action. | |
+ # The default implementation produces two log entries: |
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
-- === Utilities === {{{1 | |
withLabels :: (a -> b) -> [a] -> [(b, a)] | |
withLabels label items = (label <$> items) `zip` items | |
labelled :: [a] -> (a -> b) -> [(b, a)] | |
labelled = flip withLabels | |
----- Ruby prompts ----- {{{3 |
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 SomethingController | |
include AjapController | |
defer_response :only => :slow_operation | |
def slow_operation | |
later do |ajap| | |
Leviathan.do_something_very_slowly.callback do |result| | |
ajap.respond :status => 200, :message => result | |
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
// no annotation | |
setTimeout(function () { /* something that blows up horribly */ }, 1000); | |
// annotated, behaves identically unless it blows up | |
setTimeout(loggily("doing something hairy", function () { /* something that blows up horribly */ }), 1000); |
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 TestController < ApplicationController | |
report RuntimeError, :status => 411, :error_code => :oh_noes | |
report ArgumentError, :status => 407, :error_code => :eeep do |exception, report| | |
report[:nartiploom] = Time.now | |
report[:banditry] = exception.class.name | |
end | |
report IndexError, :status => 404 | |
def index | |
case params[:boom] | |
when 'arg' |
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
commit e5e4aebccc334809c355b7387dc1469e18be2377 | |
Author: Sam Stokes <[email protected]> | |
Date: Wed Oct 5 17:02:47 2011 -0700 | |
[2, 4, 6].should_not include_such_that(&:odd?) | |
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb | |
index c6b006b..03aeec5 100644 | |
--- a/spec/spec_helper.rb | |
+++ b/spec/spec_helper.rb |
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
import java.io.DataInputStream; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.io.ObjectInputStream; | |
import java.io.ObjectOutputStream; | |
import java.io.Serializable; | |
import backtype.storm.serialization.ISerialization; | |
public class SerializableSerialization<T extends Serializable> implements ISerialization<T> { |