Skip to content

Instantly share code, notes, and snippets.

View rskelley9's full-sized avatar

Ryan Kelley rskelley9

View GitHub Profile
@danielnolan
danielnolan / git-rebase.markdown
Last active January 28, 2019 15:36 — forked from lgmkr/git-rebase.markdown
Git rebase workflow

Checkout a new working branch

 git checkout -b <branchname>

Make Changes

 git add
 git commit

Update branch

 git checkout <branchname>

git rebase origin/develop

@rskelley9
rskelley9 / application_controller.rb
Last active October 31, 2016 05:43
How I remedied duplicate form submissions: https://www.tumblr.com/blog/ryankelley
class ApplicationController < ActionController::Base …
private
def client_will_not_cache_response
response.headers["Cache-Control”] = “no-cache, no-store”
response.headers[“Pragma”] = “no-cache”
response.headers[“Expires”] = “Fri, 01 Jan 1990 00:00:00 GMT”
end
end
@rskelley9
rskelley9 / encryption.rb
Last active February 17, 2016 06:40
This ruby program tests the authentication API I am working by standing in as the application client. (note: the RSA keypair pem files are not included and neither is the encryption password (KEY_PASS).)
require 'openssl'
require "base64"
module Encryption
class << self
# create OpenSSL keypair object, used for generated keypair
def gen_rsa_key(size=2048)
rsa_key = OpenSSL::PKey::RSA.new(size)