Skip to content

Instantly share code, notes, and snippets.

View pramodshinde's full-sized avatar

Pramod Shinde pramodshinde

View GitHub Profile
@pramodshinde
pramodshinde / rake_log_clear.rb
Created December 10, 2015 08:42
Boilerplate to test rake log:clear
## Need help to run this file
# Steps followd
# 1) cloned rails into /home/pramod/open_source/rails
# 2) added follwing
# require 'generators/generators_test_helper'
# require 'rails/generators/rails/app/app_generator'
# require 'env_helpers'
# 3) When I run `ruby rake_log_clear.rb` getting following Error
# log_clear.rb:22:in `require': cannot load such file -- generators/generators_test_helper (LoadError)
@pramodshinde
pramodshinde / spot_instances_with_linode_and_ruby.md
Created October 2, 2016 08:09
A tutorial for VPS CRUD with Linode Cloud Hosting and Ruby

How to Launch Spot Instances with Linode Cloud Hosting and Ruby

Introduction

A tutorial for VPS CRUD with Linode Cloud Hosting and Ruby. As a Rails developer have you ever wondered how to launch and delete cloud instance on demand with Ruby? In this post I will take you through how you can do a CRUD(Create, Read, Update, Delete) of a VPS or SSD Cloud server hosted on Linode.

Where to start?

To implement a VPS CRUD you need to have a Linode account and obtain a API key from profile API keys section and use this obtained API key in Linode API client gem to create API client.

Install linode client gem

@pramodshinde
pramodshinde / linode_service.rb
Last active October 2, 2016 08:23
Sample template for Linode VPS CRUD
#If you are refering this gist, I would suggest to refer my blog post and Linode gem documentation
# post url: https://pramodbshinde.wordpress.com/2016/10/01/spot-instances-with-linode
# gem url: https://github.com/rick/linode
class LinodeService
#Replace following contacts as per your needs
PLAN_ID = 1
API_KEY = 'xyz'
DATACENTERS = {
newark: 6,
@pramodshinde
pramodshinde / user_worker.rb
Last active March 23, 2018 11:11
Sample template sidekiq worker with sidekiq-status
##
# Obvious steps to follow before adding this template worker to your Rails Application
# 1. Add 'gem sidekiq-status' to Gemfile
# 2. bundle install
# 3. include Sidekiq::Status::Worker in your worker if you want tarck the progrees of your worker.
# 4. Setup Sidekiq Web & sidekiq-status Web UI's
# a. Sidekiq Web UI
# a1. Add gem 'sinatra', :require => nil to Gemfile
# a2. Add follwing to routes
# require 'sidekiq/web'
@pramodshinde
pramodshinde / git-branching.md
Last active December 11, 2019 12:53
Git branching strategy

Git Branching Strategy

Josh enforces to adopt the following described git branching strategy to keep every project on the same page when it comes to git branching.

We strongly recommend to keep following major branches in project

  • master - origin/master to be the main branch where the source code of HEAD always reflects a production-ready state(production deployed code), Direct push is not allowed into this branch.

  • staging - origin/staging to be a parallel branch to master branch to stage your features for QA and user acceptance testing.(staging deployed code)

    Note: you can also call this branch as uat

  • develop - origin/develop to be a parallel branch of master branch where the source code of HEAD always reflects a state with the latest delivered development changes for the next release (A working copy of code for every developer)

@pramodshinde
pramodshinde / talk_proposal_format.md
Last active March 12, 2021 06:14
Talk proposal formats

#Make the title good

Title: Foo beyond the basics

Abstract

Write here - A clear, convincing and brief extract of you talk

Description

More details that you will be covering in your talk (bullet points)

  • Intro to foo
@pramodshinde
pramodshinde / gmail.rb
Last active March 31, 2021 07:19
Gmail API (via IMAP) using gmail_xoauth - Example
# An example demonstrating Gmail API via IMAP using gmail_xoauth gem
# Add this file to your rails project to use if you don't want to use this in rails project then require
require 'net/imap'
require 'gmail_xoauth'
class Gmail
attr_accessor :email, :access_token
def initialize(args)
email = args[:email]