Clone repo:
git clone git://github.com/maccman/juggernaut.git
cd juggernaut
Create Heroku app:
heroku create myapp --stack cedar
heroku addons:add redistogo:nano
git push heroku master
namespace :spec do | |
# largely lifted from http://www.pervasivecode.com/blog/2007/06/28/hacking-rakestats-to-get-gross-loc/ | |
task :stats_setup do | |
require 'code_statistics' | |
class CodeStatistics | |
alias calculate_statistics_orig calculate_statistics | |
def calculate_statistics | |
@pairs.inject({}) do |stats, pair| | |
if 3 == pair.size |
Warden::Manager.serialize_into_session{|user| user.id } | |
Warden::Manager.serialize_from_session{|id| User.get(id) } | |
Warden::Manager.before_failure do |env,opts| | |
# Sinatra is very sensitive to the request method | |
# since authentication could fail on any type of method, we need | |
# to set it for the failure app so it is routed to the correct block | |
env['REQUEST_METHOD'] = "POST" | |
end | |
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title> | |
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(function () { | |
var extractToken = function(hash) { |
#!/usr/local/bin/macruby | |
# This example is done with MacRuby and the UIKit framework for Mac OS X | |
# http://chameleonproject.org/ | |
# https://github.com/BigZaphod/Chameleon/ | |
framework 'Cocoa' | |
framework "UIKit" # garbage collected version, the current version of Chameleon ist not known to be GC-safe | |
################### |
require "rubygems" | |
require "open-uri" | |
require "rack/utils" | |
require "json" | |
class Fql | |
class << self | |
attr_accessor :base_url | |
end |
Clone repo:
git clone git://github.com/maccman/juggernaut.git
cd juggernaut
Create Heroku app:
heroku create myapp --stack cedar
heroku addons:add redistogo:nano
git push heroku master
class Foo | |
include Mongoid::Document | |
field :bar | |
end | |
foo = Foo.new(:bar => "baz") | |
foo.to_json # => { _id: "(some uuid)", bar: "baz" } |
namespace :assets do | |
task :check => :environment do | |
paths = ["app/assets", "lib/assets", "vendor/assets"] | |
paths.each do |path| | |
dir_path = Rails.root + path | |
if File.exists?(dir_path) | |
dir_files = File.join(dir_path, "**") |
iPad | |
1024 × 690 In landscape on iOS 4.3 | |
1024 × 672 In landscape on iOS 5 | |
768 × 946 In portrait on iOS 4.3 | |
768 × 928 In portrait on iOS 5 | |
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3 | |
1024 × 644 Always showing bookmarks bar in landscape on iOS 5 | |
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3 |