Skip to content

Instantly share code, notes, and snippets.

# Removendo porcarias
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
# Git
git :init
file(".gitignore") do
<<-EOF

Rails 2.3.10 on App Engine (DataMapper)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TInyDS version also: gist.github.com/gists/269075

Install the Development Environment

@lucasallan
lucasallan / README.rdoc
Created December 26, 2010 03:21 — forked from woodie/README.rdoc
Rails 2.3.10 on App Engine

Rails 2.3.10 on App Engine

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the DataMapper version also: gist.github.com/671792

Install the Development Environment

One meta-gem provides the development environment

@lucasallan
lucasallan / install_postgis_osx.sh
Created September 6, 2011 21:03 — forked from klebervirgilio/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Current:
* Clean Code
* Crafting Rails Applications
Next:
* Domain-driven Design
* Design Patterns in Ruby
#!/usr/bin/env ruby
## WP2TUMBLR: WordPress 2 Tumblr Importing tool
##
## Usage: wp2tumblr [OPTION] WORDPRESS_XML_FILE
##
## Import the WORDPRESS_XML_FILE to a Tumblr blog.
## Provide `--group` option to publish to a group.
## This could take a long time...
##
## To install, download the script and chmod to 755.
@lucasallan
lucasallan / rack_keyspace_bugfix.rb
Created June 8, 2012 15:36
Fixing problem when parameter's key is nil in Rack
#
# => This is a monkey patch to fix the problem with nil key params in rack 1.4.1
# => It already be solved by Rack team but it will be release in rack 1.4.2
# => https://github.com/rack/rack/pull/329
#
module Rack::Utils
def self.parse_query(qs, d = nil)
@lucasallan
lucasallan / installing-ruby2.0.0-on-osx
Created March 6, 2013 01:42
Installing Ruby 2.0.0-p0 with RVM on OSX
Installing dependencies
brew install libxslt libxslt libksba openssl sqlite
Installing Ruby 2.0.0
rvm install 2.0.0 --with-openssl-dir=`brew --prefix openssl`
@lucasallan
lucasallan / atlassian-plugin.xml
Created July 6, 2013 16:40
Jira post-function plugin configuration
<atlassian-plugin key="com.lucasallan.jira.transitions.postfunctions"
name="Post Function Plugin" plugins-version="2">
<plugin-info>
<description>Unbounce WorkFlow Plugin</description>
<version>1.0</version>
<vendor name="Unbounce" url="http://www.lucasallan.com" />
</plugin-info>
<!-- Post Function Sample -->
<workflow-function key="add-comment" name="Comment Integration"
# just an active_record migration example for reference
# source of this logic: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
class CreateMetaTexts < ActiveRecord::Migration
def up
create_table :meta_texts do |t|
t.text :default_text_63KB, limit: 63.kilobytes # 64512 < 65535 limit for when text datatype changes to mediumtext datatype
t.text :medium_text_64KB, limit: 64.kilobytes # 65536 > 65535 limit and triggers text datatype to mediumtext datatype
t.text :medium_text_15MB, limit: 15.megabytes # 15728640 < 16777215 limit for when mediumtext changes to longtext datatype