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
ruby: | |
config_file: config/ruby-style.yml | |
javascript: | |
config_file: app/assets/javascripts/jshintrc | |
scss: | |
config_file: config/.scss-style.yml | |
StringLiterals: |
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 rvm-auto-ruby | |
heroku_apps = `heroku apps` | |
heroku_apps = heroku_apps.split("\n") | |
heroku_apps.shift | |
heroku_apps.map! {|item| item.split(" ")[0] } | |
heroku_apps.each do |app| | |
puts "#{app}: " | |
output = `heroku run "ruby -rpsych -e 'p Psych.libyaml_version.join(\\".\\")'" -a #{app}` |
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
class Person < ActiveRecord::Base | |
#... some other methods ... | |
def self.export_as_csv | |
#... generates a CSV string ... | |
end | |
end | |
#spec | |
describe Person do |
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 rvm-auto-ruby | |
heroku_apps = `heroku apps` | |
heroku_apps = heroku_apps.split("\n") | |
heroku_apps.shift | |
heroku_apps.map! {|item| item.split(" ")[0] } | |
heroku_apps.each do |app| | |
ruby_version = `heroku run "ruby -v" -a #{app}` | |
p "#{app}: #{ruby_version.split("\n")[1]}" |
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
source :rubygems | |
gem 'rails' , '3.2.3' | |
gem "unicorn" , "~> 4.3.1" | |
gem "jquery-rails" , "~> 2.0.2" | |
gem "rake" , "~> 0.9.2.2" | |
gem "pg" , "~> 0.14.0" | |
group :development, :test do | |
gem "rspec-rails" , "~> 2.10.1" |
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
heroku config:add TZ=Asia/Hong_Kong |
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
gem 'sinatra' | |
group :development,:test do | |
gem 'rspec' | |
gem 'rack-test' | |
end |
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
log4j.rootLogger=debug, stdout, file | |
### direct log messages to stdout ### | |
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | |
log4j.appender.stdout.Target=System.out | |
log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout | |
### file appender | |
log4j.appender.file=org.apache.log4j.RollingFileAppender | |
log4j.appender.file.maxFileSize=100KB |
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
from PIL import ImageFont | |
from PIL import Image | |
from PIL import ImageDraw | |
from StringIO import StringIO | |
font = ImageFont.load_default() | |
input = StringIO(self.request.get("img")) | |
img = Image.open(input) | |
draw = ImageDraw.Draw(img) |
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
#Part of a school project using SAP ERP. | |
#Created a composite application using a Linux EC2 Instance & created SOAP web services. | |
#Used Ruby to invoke enterprises services in SAP. | |
require 'rubygems' | |
require 'savon' | |
client = Savon::Client.new do | |
wsdl.document = File.read("wsdl_document.wsdl") | |
http.auth.basic "username", "password" |
NewerOlder