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
class Statistic | |
include MongoMapper::Document | |
key :format, String, :index => true, :required => true | |
key :ip, String, :index => true, :required => true | |
key :path, String, :index => true, :required => true | |
end |
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
module Rack | |
class RequestStatisticTracker | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
status, headers, response = @app.call(env) | |
path = env['REQUEST_PATH'] || env['PATH_INFO'] |
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
# tpitale_rails_template.rb | |
file 'config/routes.rb', <<-CODE | |
ActionController::Routing::Routes.draw do |map| | |
end | |
CODE | |
run "rm public/index.html" | |
run "rm public/images/rails.png" | |
run "rm public/favicon.ico" |
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
if ($request_uri ~* "\.(ico|css|js|gif|jpe?g|png)\?[0-9]+$") { | |
expires max; | |
break; | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.redis.server</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/opt/local/sbin/redis-server</string> |
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
--- | |
:benchmark: false | |
gem: --no-ri --no-rdoc | |
:update_sources: true | |
:verbose: true | |
:bulk_threshold: 1000 | |
:sources: | |
- http://gems.github.com | |
:backtrace: false |
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
<script type="text/javascript"> | |
function current_top_domain() { | |
var domain_parts = window.location.hostname.split('.'); | |
var part_count = domain_parts.length; | |
return "." + domain_parts[part_count-2] + "." + domain_parts[part_count-1]; | |
} | |
var _gaq = _gaq || []; | |
_gaq.push( |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
# - a browser with WebSocket support | |
# | |
# Usage: | |
# ruby redis_pubsub_demo.rb | |
# |
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
alias gst='git status' | |
alias gco='git checkout' | |
alias gmg='git merge' | |
alias grm='git rm' | |
alias gcm='git commit' | |
alias gtg='git tag' | |
alias gpl='git pull' | |
alias gps='git push' | |
alias gcl='git clone' | |
alias gad='git add .' |