Skip to content

Instantly share code, notes, and snippets.

View railsfactory's full-sized avatar

RailsFactory railsfactory

View GitHub Profile
@kylerush
kylerush / s3-maxcdn-deploy.py
Created January 22, 2013 18:09
Git, S3 and MaxCDN Python deploy script. The script gets the changed file between the two latest Git commits, uploads the changed files to S3 and then purges the paths from MaxCDN using the API.
#!/usr/bin/env python
#install the follow first:
#sudo easy_install pip
#sudo pip install -U boto
#sudo pip install configparser
@kirs
kirs / translate.rb
Created December 11, 2011 19:41
Google Translation API: Ruby example
require 'google/api_client'
client = Google::APIClient.new
translate = client.discovered_api('translate', 'v2')
client.authorization.access_token = '123' # dummy
client.key = "my-key-example" # your key from Google API console
response = client.execute(
:api_method => translate.translations.list,
@jzajpt
jzajpt / google_translate.rb
Created September 2, 2011 08:48
Google Translate Ruby API
# encoding: utf-8
class GoogleTranslate
BASE_URL = 'https://www.googleapis.com/language/translate/v2'
URL_OPTIONS = [ :key, :target, :source, :q, :format ]
include HTTParty
format :json
@haxney
haxney / commands_run
Created August 18, 2011 01:52
Rabl error in Rails specs
rails new rabl-test
rails generate scaffold task name:string
rails generate rspec:install
@mrdoob
mrdoob / gist:718743
Last active July 23, 2023 06:53
Simplest HTML5 drawing tool
<html>
<style>
body {
margin: 0;
padding 0;
}
</style>
<body>
<script>
@rjungemann
rjungemann / 1. restful_service.rb
Created June 2, 2010 01:51 — forked from headius/1. restful_service.rb
Sinatra-like example in JRuby with Jersey
require 'java'
java_import 'javax.ws.rs.Path'
java_import 'javax.ws.rs.GET'
java_import 'javax.ws.rs.Produces'
java_package 'com.headius.demo.jersey'
java_annotation 'Path("/helloworld")'
class HelloWorld
java_annotation 'GET'
java_annotation 'Produces("text/plain")'