-
Open a browser
# start an instance of firefox with selenium-webdriver driver = Selenium::WebDriver.for :firefox # :chrome -> chrome # :ie -> iexplore
- Go to a specified URL
import CircleButton from './CircleButton'; | |
// Init stage | |
const stage = new createjs.Stage("demo"); | |
// Button black | |
const btn = new CircleButton('Hi'); | |
btn.x = 50; btn.y = 50; | |
stage.addChild(btn); |
#!/usr/bin/env python | |
''' | |
Query on GoogleImageSearch and install resulted images by scraping. | |
To use this script install mechanize and BeautifulSoup packages as | |
easy_install mechanize | |
easy_install Beautiful |
{ | |
"Statement": [ | |
{ | |
"Sid": "AllowPublicRead", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::bucket_name_here/*" |
1. master> git pull origin master | |
2. master> git branch temp_branch | |
3. master> git checkout temp_branch | |
4. temp_branch> ...Do your stuff and commit... | |
5. temp_branch> git checkout master | |
6. master> git pull origin master | |
7. master> git checkout temp_branch | |
8. temp_branch> git rebase master | |
9. temp_branch> git checkout master | |
10. master> git merge temp_branch |
class Avatar < ActiveRecord::Base | |
attr_accessor :content_type, :original_filename, :image_data | |
before_save :decode_base64_image | |
has_attached_file :image, | |
PAPERCLIP_CONFIG.merge( | |
:styles => { | |
:thumb => '32x32#', | |
:medium => '64x64#', |
def avatar_geometry(style = :original) | |
@geometry ||= {} | |
@geometry[style] ||= Paperclip::Geometry.from_file(avatar.to_file(style)) | |
end |
namespace :load do | |
ZIP_CODE_DATA_URL = 'http://www.census.gov/tiger/tms/gazetteer/zips.txt' | |
# Swiped from ActiveRecord migrations.rb | |
def announce(message) | |
length = [0, 75 - message.length].max | |
puts "== %s %s" % [message, "=" * length] | |
end |