Skip to content

Instantly share code, notes, and snippets.

View kumaresan-rails's full-sized avatar

Kumaresan kumaresan-rails

  • Bengaluru, India
View GitHub Profile
# Cleans up branches like:
# if Shopify.rails_next?
# # Rails 5 login
# else
# # Rails 4 login
# end
module RuboCop
module Cop
module ShopifyRails
class RailsNextUnless < Cop
@kumaresan-rails
kumaresan-rails / osx-setup.md
Created May 3, 2018 05:32 — forked from zenorocha/.hyper.js
Setup macOS Sierra (10.12)

Setup macOS

I'm in a hospital in Spain and my MacBook was stolen.

Hospital Commit

Now I bought a new one and need to configure it. I have an AirPort Time Capsule that backs up everything using Time Machine, but I don't want all the crap I had in the old one. So let's get our hands dirty!

1. Update OS to latest version

@kumaresan-rails
kumaresan-rails / gist:956b4dc52e7acfd795d71fe0ff6a9917
Created March 20, 2017 04:21 — forked from wrburgess/gist:5528649
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

@kumaresan-rails
kumaresan-rails / Sublime Text 3 Build 3103 License Key - CRACK
Created February 18, 2017 07:55
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@kumaresan-rails
kumaresan-rails / clockwork-init.sh
Created January 6, 2017 13:28 — forked from tomykaira/clockwork-init.sh
Create a new project with clockwork for heroku.
#!/bin/sh
# Licence: MIT
# Created by tomykaira, 2011-10-25
if [ $# -ne 1 ]; then
echo "Give me your new project name (only)"
exit 1
fi
@kumaresan-rails
kumaresan-rails / pg_pub_sub.rb
Created January 4, 2017 18:00 — forked from chsh/pg_pub_sub.rb
PostgreSQL LISTEN/NOTIFY example for ruby
#
# A:
# pubsub = PgPubSub.new('channelname')
# pubsub.subscribe do |data|
# puts "data: #{data} is coming!"
# end
#
# B:
# pubsub = PgPubSub.new('channelname')
# pubsub.publish("hello world")
class Api::UploadsController < ApiController
def create
@upload = Upload.new(upload_params)
ensure
clean_tempfile
end
private