Skip to content

Instantly share code, notes, and snippets.

View prenagha's full-sized avatar

Padraic Renaghan prenagha

View GitHub Profile
@prenagha
prenagha / sVim.rc
Last active October 2, 2018 15:15
sVim Safari Extension settings
" sVim Safari Extension settings
" https://github.com/flipxfx/sVim
let scrollstep = 120
" Neat shortcuts
map "v" goToInput
map "c" lastClosedTab
map "e" quit
map "d" createHint
@prenagha
prenagha / karabiner.json
Created June 14, 2017 03:14
Karabiner Elements Config for Basic vi-style movements and Hyper Key
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"rules": [
@prenagha
prenagha / micropub-micro-blog-example.sh
Created April 27, 2017 22:03
Micropub sample post to Micro.blog
#!/bin/bash
# http://help.micro.blog/2017/api-posting/
# https://indieweb.org/Micropub
URL="https://micro.blog/micropub"
TOKEN="aabbcc"
CONTENT="Sample Post Here - http://example.com"
curl --verbose \

Keybase proof

I hereby claim:

  • I am prenagha on github.
  • I am prenagha (https://keybase.io/prenagha) on keybase.
  • I have a public key ASC04lRyBGeCmnZDKGqGfErdoTXJCGmx9XgSGdj5Nive8go

To claim this, I am signing this object:

@prenagha
prenagha / init.lua
Created September 30, 2016 00:36
Hammerspoon Config File, Hyper Key, Karabiner-Elements
-- hattip https://github.com/lodestone/hyper-hacks
-- hattip https://gist.github.com/ttscoff/cce98a711b5476166792d5e6f1ac5907
-- A global variable for the sub-key Hyper Mode
k = hs.hotkey.modal.new({}, '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
@prenagha
prenagha / arq-check.sh
Created May 23, 2016 14:03
Arq Backup Check
#!/bin/bash
#
# Use with Arq Backup www.arqbackup.com
# To check backup complete marker files in Amazon AWS S3
# See related script that writes these files arq-complete.sh:
# https://gist.github.com/prenagha/f11e0b800d7f1a5733dab1289febad51
#
set -e
trap 'notify' INT TERM ERR
@prenagha
prenagha / arq-complete.sh
Last active February 16, 2018 21:27
Arq Backup Complete Marker
#!/bin/bash
#
# Use with Arq Backup www.arqbackup.com
# To write a backup complete marker file to Amazon AWS S3
# Set as backup complete script in Arq settings for the backup destination
# See related script that checks these files arq-check.sh:
# https://gist.github.com/prenagha/c5d6c2ebf3de0a4f61afdf3610e57363
#
arg=$1
if [ -z "${arg}" ]
@prenagha
prenagha / version-check.js
Last active September 7, 2022 18:03
javascript version id comparison
// compare two versions, return true if local is up to date, false otherwise
// if both versions are in the form of major[.minor][.patch] then the comparison parses and compares as such
// otherwise the versions are treated as strings and normal string compare is done
var VPAT = /^\d+(\.\d+){0,2}$/;
function upToDate(local, remote) {
if (!local || !remote || local.length === 0 || remote.length === 0)
return false;
if (local == remote)
@prenagha
prenagha / compile-applescript.sh
Created September 8, 2015 00:18
Compile .applescript files to .scpt files. Useful for LaunchBar actions and such.
#!/bin/bash
#
# find all launchbar action .applescript scripts and compile them
#
LBDEV=~/Dev/launchbar
find $LBDEV -type f -name '*.applescript' -print0 | while read -d '' -r APPLESCRIPT
do
echo "Compiling $APPLESCRIPT ..."
SCPT="${APPLESCRIPT%.applescript}.scpt"
/usr/bin/osacompile -o "$SCPT" "$APPLESCRIPT"
@prenagha
prenagha / lbdist.sh
Last active January 27, 2022 17:30
Launchbar Action package script
#!/bin/bash
#
# code sign and package each launchbar action then push
# to dropbox folder for public distribution
#
# first make sure everything is compiled
# see https://gist.github.com/prenagha/404284fee1b8ff86aec5
~/bin/compile-applescript.sh
if [ $? -ne 0 ]