Skip to content

Instantly share code, notes, and snippets.

View prenagha's full-sized avatar

Padraic Renaghan prenagha

View GitHub Profile
@duhanebel
duhanebel / instapaperToYojimbo.rb
Created September 9, 2011 16:07
Instapaper CSV to Yojimbo importer
require 'rubygems'
require 'rss/1.0'
require 'rss/2.0'
require 'open-uri'
require 'appscript'
require 'syslog'
require 'csv'
require 'uri'
include Appscript
@kristianfreeman
kristianfreeman / gist:3203651
Created July 30, 2012 02:45
CSS for drang
html {
zoom: 1.5;
}
@bsneed
bsneed / NSObject+RFExtensions.h
Created October 6, 2012 06:36
perform a block in a background thread, and call a completion block on the main thread when its done.
//
// NSObject+RFExtensions.h
//
// Created by brandon on 10/5/12.
// Copyright (c) 2012 redf.net. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef void (^NSObjectPerformBlock)(id userObject);
@ttscoff
ttscoff / gmail.plist
Last active November 25, 2015 16:37
Two of my favorite MailMate Keybindings
# Two of my favorite MailMate keybindings
# <http://manual.mailmate-app.com/custom_key_bindings>
#
# g,g jumps to first message in message list
# G jumps to last message in list
{
"g" = {
"g" = ( "makeFirstResponder:", "mainOutline", "selectFirstMessageRow:");
};
"G" = ( "makeFirstResponder:", "mainOutline", "selectLastMessageRow:");
@voidfiles
voidfiles / expandurl.py
Last active December 12, 2015 09:29
I wanted to share clean URL's directly from my phone. This is most specifically geared towards feedburner URL's, but could be just short URL's as well. This script unwraps any URL's surrounded with ** in the text on your clipboard. Unwraps them, and clears out unwanted query params. Then opens the text in felix for posting.
"""
Pythonist script to expand any URL surrounded by **'s
"""
import clipboard
import requests
import webbrowser
import urlparse
from urllib import quote, urlencode
// References:
// http://manual.mailmate-app.com/custom_key_bindings
// http://manual.mailmate-app.com/key_binding_selectors
// Custom
"E" = "expandAll:"; // expands all threads in current view
"T" = "showThread:"; // lower-case t doesn't work because it's bound to tags (?)
"l" = "copyAsLink:"; // copies message:// link for selected message
"y" = ( "selectWithFilter:", "#thread-id = ${#thread-id}", "archive:"); // http://protips.maxmasnick.com/mailmate-keyboard-shortcut-to-archive-all-messages-in-a-thread
"@[" = "backInHistory:"; // moves back in history, e.g. back to mailbox after performing a search. ESC also works for this.
@adamstegman
adamstegman / available_ebooks.rb
Last active August 6, 2016 19:52
eBooks from my Goodreads to-read list that are available to check out from OverDrive, sorted by average rating on Goodreads
#!/usr/bin/env ruby
require 'json'
require 'logger'
require 'net/http'
require 'addressable/template'
require 'mechanize'
require 'nokogiri'
@JadenGeller
JadenGeller / Semaphore.swift
Last active May 16, 2017 15:51
Swift Semaphore
struct Semaphore {
let semaphore: dispatch_semaphore_t
init(value: Int = 0) {
semaphore = dispatch_semaphore_create(value)
}
// Blocks the thread until the semaphore is free and returns true
// or until the timeout passes and returns false
@christiangenco
christiangenco / add_to_reading_list
Created February 17, 2016 21:28
command line utility to add urls to the Safari iOS and Mac reading list
#!/usr/bin/env osascript
-- usage:
-- add_to_reading_list "http://google.com" "http://yahoo.com"
on run argv
repeat with arg in argv
tell app "Safari" to add reading list item (arg as text)
end repeat
end run
@rterbush
rterbush / MockSQS.java
Created October 11, 2016 14:47 — forked from UnquietCode/MockSQS.java
Mock AWS SQS implementation which operates in-memory rather than hitting the real SQS.
package com.studyblue.test.aws;
import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.ResponseMetadata;
import com.amazonaws.regions.Region;
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.model.*;
import com.google.common.hash.Hashing;