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
Pow does not support jRuby. The error you'll hit is "IOError: Socket is not connected". This PR describes a hack to get around it: https://github.com/josh/nack/pull/32 | |
Here are the steps: | |
1. Open ~/Library/Application\ Support/Pow/Current/node_modules/nack/lib/nack/server.rb | |
2. Replace line #132 with the following: | |
# OLD: sock.close_read | |
begin |
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
# lib/rails_routes_reloader.rb | |
class RailsRoutesReloader | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
reload_routes_if_changed | |
return *@app.call(env) |
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
package jruby.ext; | |
import java.util.Arrays; | |
import javax.servlet.ServletContext; | |
import javax.servlet.ServletContextEvent; | |
import javax.servlet.ServletContextListener; | |
import org.jruby.embed.ScriptingContainer; | |
/** | |
* Launch a Ruby script at web application startup. To wire up this |
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 | |
# Trivial little twitter script | |
# Pass it a list of names as command line arguments | |
# and it will return a list of all people who follow everyone in the | |
# list. | |
# A person is implicitly assumed to follow themselves, so if foo follows | |
# bar and bar follows foo then common_followers foo bar would include | |
# both foo and bar in the output, but if bar did not follow foo it | |
# would include neither. |
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
# Backs up all the photos from Google Picasa Web Albums. | |
# | |
# The script downloads the original version of the photos, and is not limited to | |
# 1600x1200 thumbnails. | |
# | |
# Author:: Victor Costan | |
# Copyright:: Copyright (C) 2010 Victor Costan | |
# License:: MIT | |
require 'yaml' |
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
rack-contrib | |
rack-rewrite |
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 'sinatra' | |
require 'omniauth' | |
class Application < Sinatra::Base | |
use OmniAuth::Builder do | |
provider :github, 'github_id', 'github_secret' | |
end | |
get '/' do |
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 'fog' | |
require 'chef/knife/ec2_server_create' | |
connection = Fog::AWS::Compute.new( | |
:aws_access_key_id => Chef::Config[:knife][:aws_access_key_id], | |
:aws_secret_access_key => Chef::Config[:knife][:aws_secret_access_key], | |
:region => Chef::Config[:knife][:region] | |
) | |
server = connection.servers.create( |
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
framework 'Cocoa' | |
framework 'Foundation' | |
class Growl | |
GROWL_IS_READY = "Lend Me Some Sugar; I Am Your Neighbor!" | |
GROWL_NOTIFICATION_CLICKED = "GrowlClicked!" | |
GROWL_NOTIFICATION_TIMED_OUT = "GrowlTimedOut!" | |
GROWL_KEY_CLICKED_CONTEXT = "ClickedContext" | |
def initialize(app, notifications, icon = nil) |
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
// | |
// UIViewController+MBSensitiveInformationInScreenshotPrevention.h | |
// | |
// Created by Manuel Binna on 05.05.11. | |
// Copyright 2011 Manuel Binna. All rights reserved. | |
// | |
@interface UIViewController (MBSensitiveInformationInScreenshotPrevention) |
OlderNewer