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
namespace :release do | |
desc "get current commit in remote server" | |
task :before do | |
begin | |
remote_sha = capture("cd #{current_path}; git rev-parse --verify HEAD") | |
set :remote_before_commit, remote_sha.strip | |
# first time deploy can throw exception | |
rescue | |
end | |
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
#!/bin/bash | |
sudo apt-get update | |
# To make sure we have everything necessary for Webpacker support in Rails, we're first going to start by adding the Node.js and Yarn repositories to our system before installing them. | |
sudo apt-get install curl | |
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - | |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
sudo apt-get update |
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
# ActiveRecord::Base.logger.level = 1 | |
# IRB.conf[:ECHO] = false | |
# Overriding Object class | |
class Object | |
# Easily print methods local to an object's class | |
def lm | |
(methods - Object.instance_methods).sort | |
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
class GenericJob | |
include Sidekiq::Job | |
def perform(klass, id, undelayed_method, *args) | |
object = klass.constantize.find(id) | |
object.send(undelayed_method, *args) | |
end | |
end |