Skip to content

Instantly share code, notes, and snippets.

View sdemontfort's full-sized avatar

Stephen sdemontfort

View GitHub Profile
@sdemontfort
sdemontfort / base.php
Last active August 29, 2015 14:06
Laravel 3 Eloquent single object caching
<?php
/**
* Override eloquent to provide caching on single objects.
* Note: This will cache items forever, and will create new cache files
* upon updates, so that the latest cache item will always be used.
* The goal is to move towards this approach:
* https://signalvnoise.com/posts/3113-how-key-based-cache-expiration-works
*
* P.S this should be used with Memcached
@sdemontfort
sdemontfort / flowdock-style-override.css
Last active June 11, 2017 09:43
Slack-like styles for Flowdock's gross UI
/* i really want this to be global */
/* latin-ext */
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 300;
src: local('Lato Light'), local('Lato-Light'), url(https://fonts.gstatic.com/s/lato/v13/IY9HZVvI1cMoAHxvl0w9LVKPGs1ZzpMvnHX-7fPOuAc.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@sdemontfort
sdemontfort / rename-parameter-store-values.rb
Last active October 4, 2022 19:00
Rename AWS Parameter Store Values
require 'json'
# Rename parameter store paths. Takes:
# - parameter store json file path
# - old path
# - new path to use
old_path, new_path, _rest = ARGV
params = `aws ssm get-parameters-by-path --path #{old_path} --with-decryption`
params = JSON.parse(params, object_class: OpenStruct)