Skip to content

Instantly share code, notes, and snippets.

View joelcarranza's full-sized avatar

Joel Carranza joelcarranza

View GitHub Profile
# template.txt
name = My Packing List
favorite = true
# Template for when I need to pack on a trip
* "The Journey Not The Arrival Matters"
by T.S Elliot
- phone
- charger
/*-------------------------------------------------------------------
Opens any URLs found in the title or note of selected Omnifocus tasks
Source: https://gist.github.com/joelcarranza/272124a83024a69c046d
-------------------------------------------------------------------*/
ObjC.import('stdlib')
ObjC.import('AppKit')
/*-------------------------------------------------------------------
Create Omnifocus Task For Active Tab
Quickly create a task for a given tab. The task title is the name of
the tab and the note contains a URL to that tab
Source:
https://gist.github.com/joelcarranza/cc5d88553ed9cdcafa26
-------------------------------------------------------------------*/
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""marked_processor.py
Pre-procceser for Marked.app which converts notation for structured notes
into HTML
Source:
https://gist.github.com/joelcarranza/1b572b67ec2947961105
"""
<html>
<title>Inspect Me</title>
<style>
body {
margin: 20px;
font-size: 18px;
}
img {
@joelcarranza
joelcarranza / pinswift-bookmarklet.js
Last active April 17, 2020 14:22
bookmarklet template for Pinswift
// bookmarklet template for Pinswift
// This can be copied into a bookmarklet maker like:
// http://chriszarate.github.io/bookmarkleter/
// Or used with Gruber's script
// http://daringfireball.net/2007/03/javascript_bookmarklet_builder
var href = location.href;
var path = 'pinswift://x-callback-url/add';
@joelcarranza
joelcarranza / pinner.js
Created May 7, 2013 13:35
particular-pinboard for Pinner
(function(){var e=false;var t="pinner://x-callback-url/bookmark?";var r=false;var n={javascript:"javascript",js:"javascript",python:"python",ios:"ios",youtube:"video",vimeo:"video",video:"video",books:"book",book:"book"};var o={"github.com":".entry-title .js-current-repository"};var i={"www.kickstarter.com":".short-blurb"};var a=function(e){return e.toLowerCase()};var c=function(e){return e?e.textContent.trim().replace(/\s+/g," "):null};var u=a(document.title);var l=function(e){if(e){return u.indexOf(a(e))!=-1}else{return false}};var f=function(e,t,r){r=r||window;var n=e.length;var o;for(var i=0;i<n;++i){o=t.call(r,e.item(i));if(o!==null){return o}}return null};var v=function(){var e=location.href;var t=location.hostname;var r;if(t in o){r=document.querySelector(o[t]);if(r){return c(r)}}var n=document.title;var r=document.querySelector("meta[property='og:title']");if(r){n=r.content.trim().replace(/\s+/g," ")}var i,a;if(f(document.getElementsByClassName("hentry"),function(e){return true})){var u=document.query
package org.sqlite;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* Example of invoking Statement.cancel() on long running query. If the query is expensive and blocks for a significant