Skip to content

Instantly share code, notes, and snippets.

View ctrochalakis's full-sized avatar

Christos Trochalakis ctrochalakis

View GitHub Profile
@ctrochalakis
ctrochalakis / Gemfile
Created May 12, 2010 06:53 — forked from jwang/Gemfile
Rest json
# Critical default settings:
disable_system_gems
disable_rubygems
bundle_path '.gems/bundler_gems'
# List gems to bundle here:
gem 'rails_dm_datastore'
gem 'rails', "2.3.5"
gem 'dm-core'
gem "json-jruby"
#!/usr/bin/env ruby
# Usage: gemspec [-s] GEMNAME
#
# Prints a basic gemspec for GEMNAME based on your git-config info.
# If -s is passed, saves it as a GEMNAME.gemspec in the current
# directory. Otherwise prints to standard output.
#
# Once you check this gemspec into your project, releasing a new gem
# is dead simple:
#
require 'mustache'
module ExistentialMethodMissing
def method_missing(method, *args)
return super unless method.to_s =~ /\?$/
val = send(method.to_s.chomp('?'))
val.respond_to?(:empty?) ? !val.empty? : !!val
end
def respond_to?(method)
# directory structure of /ruby
$ tree -L 1 /ruby
/ruby
|-- default -> ree-1.8.7
|-- ree-1.8.7
`-- ruby-1.9.1-p376
3 directories, 0 files
window.onorientationchange = function() {
if (window.orientation == 0) {
$('#sidebar').fadeOut()
} else {
$('#sidebar').fadeIn()
}
}
gemcutter => redis downloads spec
=================================
keys
----
downloads => global counter for all gem downloads
downloads:today => sorted set for downloads from today
downloads:rubygem:rails => counter for all rails downloads
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads
var Timezone = {
set : function() {
var date = new Date();
date.setTime(date.getTime() + (1000*24*60*60*1000));
var expires = "; expires=" + date.toGMTString();
document.cookie = "timezone=" + (-date.getTimezoneOffset() * 60) + expires + "; path=/";
}
}
From bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001
From: Ilya Grigorik <[email protected]>
Date: Thu, 10 Jun 2010 00:46:48 -0400
Subject: [PATCH] async rails3
---
Gemfile | 6 ++++++
app/controllers/widgets_controller.rb | 6 ++++++
app/models/widget.rb | 2 ++
config.ru | 1 +
From bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001
From: Ilya Grigorik <[email protected]>
Date: Thu, 10 Jun 2010 00:46:48 -0400
Subject: [PATCH] async rails3
---
Gemfile | 6 ++++++
app/controllers/widgets_controller.rb | 6 ++++++
app/models/widget.rb | 2 ++
config.ru | 1 +
user nginx;
worker_processes 5;
error_log /var/log/nginx.error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}