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
[Thu Nov 08 19:01:37 2012] [notice] caught SIGTERM, shutting down |
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
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio | |
> print "hello world" | |
hello world | |
> |
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
Counting objects: 17, done. | |
Delta compression using up to 2 threads. | |
Compressing objects: 100% (9/9), done. | |
Writing objects: 100% (9/9), 1005 bytes, done. | |
Total 9 (delta 7), reused 0 (delta 0) | |
-----> Heroku receiving push | |
-----> Removing .DS_Store files | |
-----> Ruby/Rails app detected | |
-----> Installing dependencies using Bundler version 1.1.pre.10 |
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 'hominid' | |
mc = Hominid::Base.new({:api_key => 'you-api-key-goes-here'}) | |
list = mc.find_list_by_name('Name of Your Subscriber List') | |
users = User.all | |
users.each {|u| mc.subscribe(list['id'], u.email, {:FNAME => u.first, :LNAME => u.last}) } |
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 'aws/s3' | |
=> true | |
>> include AWS::S3 | |
=> Object | |
>> AWS::S3::Base.establish_connection!(:access_key_id => 'REDACTED', :secret_access_key => 'REDACTED') | |
=> #<AWS::S3::Connection:0x1016de910 ... :port=>80}> | |
>> file = S3Object.find 'tv/BF-TV-Episode-001.ogv', 'cloud.bigfolio.com' | |
=> #<AWS::S3::S3Object:0x2159355220 '/cloud.bigfolio.com/tv/BF-TV-Episode-001.ogv'> | |
>> file.content_type | |
=> "binary/octet-stream" |
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
# Request from an iPhone or iPod touch? (Mobile Safari user agent) | |
def iphone_user_agent? | |
request.env["HTTP_USER_AGENT"] && request.env["HTTP_USER_AGENT"][/(Mobile\/.+Safari)/] | |
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
#!/usr/bin/env ruby | |
#################################### | |
# How to get and parse query string | |
# data in Ruby | |
#################################### | |
require 'rubygems' | |
require 'open-uri' | |
require 'cgi' |
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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'open-uri' | |
site = 'http://somedomain.com' | |
file = 'index2.php' | |
begin | |
html = open(File.join(site,'index2.php')).read | |
rescue OpenURI::HTTPError |