This file contains hidden or 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
# | |
# Usage: | |
# class ApplicationController < ActionController::Base | |
# include ErrorPages | |
# end | |
# | |
require 'active_support/core_ext/array/extract_options' | |
module ErrorPages | |
extend ActiveSupport::Concern |
This file contains hidden or 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
# As always, I hope I didn't reinvent the wheel or do something stupid... If I have please let me know! | |
# | |
# I'm currently using this with async_sinatra; haven't tested it without (sorry!) | |
# | |
# Example method usage: | |
# | |
# before_filter [[:apost, "/users/?"] do | |
# require_login | |
# end |
This file contains hidden or 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
PGP.net goes down from time to time, and incase it does you can use this to add the NewRelic key: | |
wget -O - http://download.newrelic.com/548C16BF.gpg | apt-key add - |
This file contains hidden or 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 'net/http' | |
require 'uri' | |
url = URI.parse('http://stream.kpsu.org:8080/listen') | |
# This thread is used to kill the recording thread after the | |
# designated amount of time. | |
timelimit = Thread.new do | |
# running_time_in_seconds is how many seconds the clip should be | |
# one hour = 3600 seconds |
NewerOlder