Skip to content

Instantly share code, notes, and snippets.

Padraic Renaghan prenagha

Block or report user

Report or block prenagha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
prenagha / RedirectCanonical.js
Created Sep 2, 2019
Lambda@Edge to redirect from non-canonical ( to canonical (
View RedirectCanonical.js
'use strict';
* Deploy this Lambda@Edge, in Origin Request event,
* to a CloudFront distribution that hosts the
* NON-Canonical domains. It will redirect everything
* to the canonical version of the URL.
* And let CloudFront and browsers cache the redirect.
exports.handler = (event, context, callback) => {
prenagha / DefaultIndexHTML.js
Created Sep 2, 2019
Lambda@Edge to redirect to default HTML page
View DefaultIndexHTML.js
'use strict';
const path = require('path');
* Redirects URI to default document.
* Any URI without an extension is assumed to be
* a directory reference and will have '/index.html'
* appended to the URI.
* Useful as Lambda@Edge on CloudFront Origin Request event
prenagha /
Last active Oct 31, 2018
Lambda CloudWatch Log Retention Manager
import boto3
import os
def lambda_handler(event, context):
default_region = os.environ.get('AWS_REGION', 'us-east-1')
retain_days = int(os.environ.get('RETAIN_DAYS', '30'))
session = boto3.Session()
client = session.client('ec2', region_name=default_region)
prenagha / log-retain-manager-policy.json
Last active Oct 17, 2018
Set the retention days on any AWS CloudWatch log group that isn't set yet
View log-retain-manager-policy.json
"Version": "2012-10-17",
"Statement": [
"Sid": "SetLogRetain",
"Effect": "Allow",
"Action": [
prenagha / DebugEvent.js
Created Oct 16, 2018
Lambda@Edge CloudFront Debugging Sample Records
View DebugEvent.js
'use strict';
* Lambda@Edge to log CloudFront event and context.
* Note: this runs in Lambda@Edge which means it runs in a variety
* of regions, the region closest to the browser making the request.
* So be sure and check other regions if you don't see the logs in
* CloudWatch in the region you normally use.
prenagha / sVim.rc
Last active Oct 2, 2018
sVim Safari Extension settings
View sVim.rc
" sVim Safari Extension settings
let scrollstep = 120
" Neat shortcuts
map "v" goToInput
map "c" lastClosedTab
map "e" quit
map "d" createHint
prenagha / karabiner.json
Created Jun 14, 2017
Karabiner Elements Config for Basic vi-style movements and Hyper Key
View karabiner.json
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
"profiles": [
"complex_modifications": {
"rules": [
prenagha /
Created Apr 27, 2017
Micropub sample post to
CONTENT="Sample Post Here -"
curl --verbose \

Keybase proof

I hereby claim:

  • I am prenagha on github.
  • I am prenagha ( on keybase.
  • I have a public key ASC04lRyBGeCmnZDKGqGfErdoTXJCGmx9XgSGdj5Nive8go

To claim this, I am signing this object:

prenagha / init.lua
Created Sep 30, 2016
Hammerspoon Config File, Hyper Key, Karabiner-Elements
View init.lua
-- hattip
-- hattip
-- A global variable for the sub-key Hyper Mode
k ={}, 'F18')
-- Hyper+key for all the below are setup somewhere
-- The handler already exists, usually in Keyboard Maestro
-- we just have to get the right keystroke sent
You can’t perform that action at this time.