Skip to content

Instantly share code, notes, and snippets.

View pbharadiya's full-sized avatar
🎯
Happy Coding!

Parth Bharadiya pbharadiya

🎯
Happy Coding!
View GitHub Profile
@pbharadiya
pbharadiya / gist:daa8f98d59055e4650308e57e93bf5ab
Created May 16, 2018 07:30 — forked from ben-av/gist:3608264
Capistrano - deployment email with list of git commits
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
@pbharadiya
pbharadiya / install.sh
Created May 6, 2019 09:46 — forked from maanavshah/install.sh
Install and Configure Ruby on Rails, MongoDB, PostgreSQL, Git, Sublime Text, Oh-my-zsh and Deepin on Ubuntu
#!/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
@pbharadiya
pbharadiya / .irbrc
Created May 8, 2020 12:53 — forked from rishiip/.irbrc
This is my current irbrc file which contains lots of helpful things.
# 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
@pbharadiya
pbharadiya / generic_job.rb
Created July 21, 2022 06:40 — forked from ayerdines/generic_job.rb
handle_asynchronously, delay with sidekiq, make sidekiq work with instance methods
class GenericJob
include Sidekiq::Job
def perform(klass, id, undelayed_method, *args)
object = klass.constantize.find(id)
object.send(undelayed_method, *args)
end
end