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
#!/usr/bin/env python | |
#install the follow first: | |
#sudo easy_install pip | |
#sudo pip install -U boto | |
#sudo pip install configparser |
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
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, |
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
# 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 |
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
rails new rabl-test | |
rails generate scaffold task name:string | |
rails generate rspec:install |
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
<html> | |
<style> | |
body { | |
margin: 0; | |
padding 0; | |
} | |
</style> | |
<body> | |
<script> |
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
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")' |