Skip to content

Instantly share code, notes, and snippets.

View KieranP's full-sized avatar

Kieran Pilkington KieranP

View GitHub Profile
@ebababi
ebababi / Dockerfile
Created November 10, 2019 20:17
Ruby on Rails Deployment Image: Builds a ready to be deployed image of a Ruby on Rails application.
# Ruby on Rails Deployment Image
#
# Builds a ready to be deployed image of a Ruby on Rails application.
# https://ebababi.net/dockerfile-for-ruby-on-rails-deployments.html
# Copyright (C) 2019 Nikolaos Anastopoulos, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@KieranP
KieranP / 1 app-models-session.rb
Last active October 8, 2020 16:11
A Ruby on Rails implementation of a Database and Cookie hybrid session storage for Devise that supports session revocation and storage of session ip and user agent for security (similar to Github)
# A user session class, a simplified mix of the following code samples:
# * https://github.com/blog/1661-modeling-your-app-s-user-session
# * http://www.jonathanleighton.com/articles/2013/revocable-sessions-with-devise/
class Session < ActiveRecord::Base
# Uncomment if you use Hobo Fields, else add these yourself
# fields do
# session_id :string, :index => true, :unique => true
# accessed_at :datetime
# user_ip :string
@KieranP
KieranP / .0 Git Status Console Prompt
Last active August 30, 2015 04:55
Console script to print which git branch you're in and its current status to the shell prompt
======
README
======
This will add a display of the current directories Git state.
Warning: This script relies on a Git version of 1.7.2 or higher!
Install
-------