https://rvm.io/integration/sudo
# deploy.rb
desc "Export Upstart script"
https://rvm.io/integration/sudo
# deploy.rb
desc "Export Upstart script"
| rake local_gem:init | |
| rake local_gem:update_projects | |
| cd project_dir | |
| begin | |
| abort if git_staging_dirty? | |
| bundle_update(gem_name) | |
| abort unless lockfile_modified? | |
| git_add(gem_name) | |
| git_commit(MSG_GEM_UPDATED, gem_name) |
| require 'date' | |
| # 1) this doesn't work, why? | |
| format = "%-m/%-d/%Y %-l:%M:%S %p" | |
| d = DateTime.new(2014,6,5,1,5,9) | |
| d == DateTime.strptime(d.strftime(format), format) # raised ArgumentError: invalid date | |
| # 2) this works, why? | |
| format = "%-m/%-d/%Y %-l:%M:%S %p" | |
| format2 = "%m/%d/%Y %l:%M:%S %p" |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| BEGIN { | |
| require 'net/http' | |
| Net::HTTP.module_eval do | |
| alias_method '__initialize__', 'initialize' | |
| def initialize(*args,&block) | |
| __initialize__(*args, &block) |
| import java.util.*; | |
| import java.lang.*; | |
| import java.io.*; | |
| import java.security.*; | |
| import java.math.*; | |
| class MD5Example | |
| { | |
| public static void main (String[] args) throws java.lang.Exception | |
| { |
| <snippet> | |
| <content><, [${1:old_version}...${2:new_version}](https://github.com/rails/rails/compare/v${1:old_version}...v${2:new_version}) | |
| - Updated: actionmailer, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/actionmailer/CHANGELOG.md)) | |
| - Updated: actionpack, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/actionpack/CHANGELOG.md)) | |
| - Updated: actionview, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/actionview/CHANGELOG.md)) | |
| - Updated: activejob, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/activejob/CHANGELOG.md)) | |
| - Updated: activemodel, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/activemodel/CHANGELOG.md)) |
This is an example of how I combine interaction/service classes with Wisper event broadcasting in Rails.
In this example, I show a UsersController#create API, a corresponding service object, and all the test code/listeners to make it all happen.
The outcome is:
object.save in dozens of places.grep for usage of it.| # based on the following: | |
| # http://saintgimp.org/2013/01/22/merging-two-git-repositories-into-one-repository-without-losing-file-history/ | |
| # http://blog.caplin.com/2013/09/18/merging-two-git-repositories/ | |
| git clone repo_main | |
| git clone repo_sub | |
| cd repo_main | |
| git remote add repo_sub ../repo_sub | |
| git fetch repo_sub |