Skip to content

Instantly share code, notes, and snippets.

View kannans's full-sized avatar
💻
☝️

Kannan S kannans

💻
☝️
View GitHub Profile
@kannans
kannans / 1 Gist conventions
Created November 6, 2017 06:01 — forked from PavloBezpalov/1 Gist conventions
Deploy Rails 4.2.6 to VPS(Ubuntu 14.04.4 LTS). Nginx, Puma, Capistrano3, PostgreSQL.
<<USER>> <<APP>> change this variables
@kannans
kannans / splitter.rb
Last active September 27, 2017 05:42
convert large files in to pieces and merge it back to original using command line approach
# Split the laracroft movie file into 100MB of each.
# This is Mac command. Just remove prefix "g" from "gsplit" will work with linux.
system "gsplit --bytes=100m lara.mp4 lar_vide_"
# Output: lar_vide_aa .. lar_vide_af
# merge it back to original file
system "cat lar_vide_* > original_lara_yourback.mp4"
@kannans
kannans / rails http status codes
Created June 1, 2017 13:26 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@kannans
kannans / Heroku - godday.md
Last active May 29, 2017 15:28
How to configure godday domain with heroku app. Just a simple

Heroku

If you already have heroku account login to account settings. Unfortunatly you need to verify you account with credicard (no charges). I just a verification. Once the account verified, navigate to app settings which you have example.herokuapp.com Click on add domain and enter the following items one by one

*.example.com
http://example.com
www.example.com
@kannans
kannans / gist:fb66121e67b7cfb9038fc758192f9d95
Created February 3, 2017 18:35 — forked from shripadk/gist:552554
Setting up Heroku Hostname SSL with GoDaddy SSL Cert
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS
@kannans
kannans / multiple_ssh_setting.md
Created December 1, 2016 05:24 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@kannans
kannans / Rspec
Created November 16, 2016 15:37
pager
require 'spec_helper'
describe Pager do
it 'has a version number' do
expect(Pager::VERSION).not_to be nil
end
it 'does first useful' do
recs = [1,3,5]
rpage = Pager::RandomRecord.new(recs, random: false)
@kannans
kannans / count.js
Last active November 6, 2016 16:10
// CSS
.jst-hours {
float: left;
}
.jst-minutes {
float: left;
}
.jst-seconds {
float: left;
}
@kannans
kannans / RailsBootstrap.md
Last active October 8, 2016 18:11
RailsBootstrap

Gem file

gem 'bootstrap-sass', '~> 3.3.6'
gem 'nested_form'` # nested form

application.css -> application.scss

@import "bootstrap-sprockets";
@import "bootstrap";
$.get("http://ipinfo.io", function (response) {
$("#ip").html("IP: " + response.ip);
$("#address").html("Location: " + response.city + ", " + response.region);
$("#details").html(JSON.stringify(response, null, 4));
}, "jsonp");