Skip to content

Instantly share code, notes, and snippets.

View prenagha's full-sized avatar

Padraic Renaghan prenagha

View GitHub Profile
@prenagha
prenagha / raindrop-add.sh
Created March 2, 2020 02:45
Add Link to Raindrop
#!/usr/local/bin/bash
URL="$1"
if [ -f "${URL}" ]
then
URL=`cat ${URL}`
fi
/usr/bin/curl --fail --silent \
--data "{ \"link\": \"${URL}\", \"collection\": { \"\$ref\":\"collections\", \"\$id\": 111 }}" \
@prenagha
prenagha / VPN Toggle.scpt
Created November 5, 2012 15:16
VPN toggle applescript for launchbar
--
-- applescript to toggle connection state of vpn
-- http://markupboy.com/blog/view/toggling-vpn-with-applescript
-- http://www.plankdesign.com/blog/2012/06/toggle-your-network-settings-with-launchbar/
--
tell application "System Events"
tell current location of network preferences
-- set this to the name of your VPN config
set VPNservice to service "vpn service name"
set isConnected to connected of current configuration of VPNservice
--
-- open currently open URL in Safari in Chrome
-- forked from https://gist.github.com/3151932
--
property theURL : ""
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
if appIsRunning("Google Chrome") then
@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 / bulkUnwatch.sh
Created July 12, 2012 15:33
JIRA Bulk Unwatch
#
# Bulk Unwatch
# JIRA doesn't support unwatch from the bulk change action
# This script fills the gap
# Known to work with JIRA 5 via the REST API
#
# 1. Using JIRA, Issue Navigator, write a query to get all
# the issues you want to unwatch. Something like
# "issue in watchedIssues() AND status != Closed"
# works well as a starting point.
This file has been truncated, but you can view the full file.
Date/Time: 2021-09-10 14:50:15.467 -0400
End time: 2021-09-10 15:48:19.923 -0400
OS Version: macOS 11.5.2 (Build 20G95)
Architecture: x86_64h
Report Version: 32
Share With Devs: Yes
Data Source: Stackshots
Shared Cache: 0C9EB0DE-F5CE-3AFC-8F08-0C6DB1E7FC44 slid base address 0x7fff20035000, slide 0x35000
@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 ]
@prenagha
prenagha / DebugEvent.js
Created October 16, 2018 22:27
Lambda@Edge CloudFront Debugging Sample Records
'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.
*
* https://medium.com/@jbesw/postcards-from-lambda-the-edge-11a43f215dc1
@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 / feed.xml
Last active October 4, 2022 15:51
NY Times book feedbin full content error
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:nyt="http://www.nytimes.com/namespaces/rss/2.0" version="2.0">
<channel>
<title>NYT &gt; Books</title>
<link>https://www.nytimes.com/section/books</link>
<atom:link href="https://rss.nytimes.com/services/xml/rss/nyt/Books.xml" rel="self" type="application/rss+xml"/>
<description/>
<language>en-us</language>
<copyright>Copyright 2022 The New York Times Company</copyright>
<lastBuildDate>Tue, 04 Oct 2022 15:40:16 +0000</lastBuildDate>