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
Process: ROClientGame [4953] | |
Path: /Users/pglombardo/Applications/Realms Online/live/./ROClientGame.app/Contents/MacOS/ROClientGame | |
Identifier: ??? | |
Version: () | |
Code Type: X86 (Native) | |
Parent Process: ??? [1] | |
Date/Time: 2011-06-02 23:27:29.648 -0400 | |
OS Version: Mac OS X 10.6.7 (10J869) | |
Report Version: 6 |
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
Process: ROClientGame [92712] | |
Path: /Users/pglombardo/Applications/Realms Online/live/./ROClientGame.app/Contents/MacOS/ROClientGame | |
Identifier: ??? | |
Version: () | |
Code Type: X86 (Native) | |
Parent Process: ??? [1] | |
Date/Time: 2011-06-10 20:20:17.983 -0400 | |
OS Version: Mac OS X 10.6.7 (10J869) | |
Report Version: 6 |
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
# | |
# = Capistrano database.yml task | |
# | |
# Provides a couple of tasks for creating the database.yml | |
# configuration file dynamically when deploy:setup is run. | |
# | |
# Category:: Capistrano | |
# Package:: Database | |
# Author:: Simone Carletti <[email protected]> | |
# Copyright:: 2007-2010 The Authors |
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 'benchmark' | |
require 'logger' | |
logger = Logger.new("/dev/null") | |
logger.level = Logger::INFO | |
puts "Simple Strings" | |
Benchmark.bmbm do |x| | |
x.report("string form") { | |
x = 0 |
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
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html | |
# https://www.varnish-cache.org/trac/wiki/VCLExamples | |
# Summary | |
# 1. Varnish will poll the backend at /health_check to make sure it is | |
# healthy. If the backend goes down, varnish will server stale content | |
# from the cache for up to 1 hour. | |
# 2. Varnish will pass X-Forwarded-For headers through to the backend | |
# 3. Varnish will remove cookies from urls that match static content file | |
# extensions (jpg, gif, ...) |
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
# Don't serve cached pages for logged in users | |
if (req.http.Cookie ~ "logged_in_cookie=") { | |
return(pass); | |
} |
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
# config/routes.rb | |
devise_for :users, :controllers => { :registrations => :sessions => "sessions" } | |
# app/controllers/sessions_controller.rb | |
class SessionsController < Devise::SessionsController | |
# POST /resource/sign_in | |
def create | |
cookies[:logged_in_cookie] = "#{SecureRandom.hex(16)}" | |
super | |
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
# Set cache headers unless this user is logged in | |
expires_in 1.hour, :public => true, 'max-stale' => 0 unless current_user |
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
gem 'gchartrb' | |
gem 'google_charts' |
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
class ChartsController < ApplicationController | |
def index | |
GoogleChart::PieChart.new('320x200', "Pie Chart",false) do |pc| | |
pc.data "Apples", 40 | |
pc.data "Banana", 20 | |
pc.data "Peach", 30 | |
pc.data "Orange", 60 | |
@chart_url = pc.to_url | |
end | |
end |
OlderNewer