Skip to content

Instantly share code, notes, and snippets.

View dmitryrck's full-sized avatar

Dmitry L Rocha dmitryrck

View GitHub Profile
@woodie
woodie / README.rdoc
Created March 17, 2010 08:35
Rails 3 on App Engine

Rails 3.0.pre on App Engine

You can Rails 3 on App Engine, but it won’t be especially useful until bundler 10. You should try these instead:

Install the Development Environment

The gems for the development environment include a pre-release appengine-tools gem that provides a pre-release version of jruby-rack.

#!/bin/sh
#
# init.d script with LSB support.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
@ctrochalakis
ctrochalakis / dalton.rb
Created June 11, 2010 12:17
facebook, google, twitter, yahoo warden strategies
require 'dalton/strategies/skroutz'
require 'dalton/strategies/facebook'
require 'dalton/strategies/openid' # yahoo, #google
require 'dalton/strategies/twitter'
# Setup OpenId file storage, don't change the storage engine!
require 'openid/store/filesystem'
Rails.configuration.middleware.use(Rack::OpenID,
OpenID::Store::Filesystem.new(Rails.root + 'tmp/openid'))
@Arcath
Arcath / gist:481321
Created July 19, 2010 12:19
gravatar avatar url generating helper method, simply pass an email to it
def gravatar_url(email,options = {})
require 'digest/md5'
hash = Digest::MD5.hexdigest(email)
url = "http://www.gravatar.com/avatar/#{hash}"
options.each do |option|
option == options.first ? url+="?" : url+="&"
key = option[0].to_s
value = option[1].to_s
url+=key + "=" + value
end
@viniciusteles
viniciusteles / gist:556029
Created August 29, 2010 06:20
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
@onedesign
onedesign / mongodb-upstart.sh
Created January 4, 2011 21:29
Ubuntu upstart script for MongoDB with automatic repair
# Ubuntu upstart file at /etc/init/mongodb.conf
pre-start script
mkdir -p /var/lib/mongodb/
mkdir -p /var/log/mongodb/
end script
start on runlevel [2345]
stop on runlevel [06]
@koshigoe
koshigoe / mount-ram.sh
Created February 11, 2011 14:57
Like tmpfs in Mac OSX
#!/bin/sh
# This program has two feature.
#
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
#
# Usage:
# $0 <dir> <size>
#
@fnando
fnando / certificate.rb
Created April 15, 2011 00:41
Create PDF using Prawn
require "prawn"
class Certificate
attr_accessor :path
PDF_OPTIONS = {
:page_size => "A5",
:page_layout => :landscape,
# :background => "public/images/cert_bg.png",
:margin => [40, 75]
@mislav
mislav / itgetsbetter.md
Created April 15, 2011 19:42
Employees of popular companies for the It Gets Better project

Employees of popular companies for the [It Gets Better project][igb]

Employees of several high-profile companies made videos with the message of hope to LGBTQ (lesbian, gay, bisexual, transsexual, queer) youth. For some reason, however, they didn't post it to their official channels on YouTube.

  • [Pixar video][pv] was posted on the [PixGetsBetter][] (1 video total) instead of the [DisneyPixar][] channel,
  • [Google video][gv] was added to [betterintech][] (6 videos total) instead of the [Google][] channel,
  • [Apple video][av] is on the [AppleEmployees][] (1 video total) instead of the [Apple][] channel,
  • [Adobe video][adv] was posted on the [AdobeItGetsBetter][] channel (1 video total), but it appears there's no official channel for Adobe.

All these unofficial channels were created for the sole purpose of posting these videos.

@caironoleto
caironoleto / gist:953305
Created May 3, 2011 13:12
balancer.load.com
upstream my.balancer.load.com {
server 80.80.80.80:8080;
server 80.80.80.80:8181;
server 81.81.81.81:8080;
server unix:/path/to/your/socket;
}
server {
listen 80;
server_name balancer.load.com