Skip to content

Instantly share code, notes, and snippets.

View semikolon's full-sized avatar

Fredrik Bränström semikolon

View GitHub Profile
@henrik
henrik / hash_deep_diff.rb
Created July 14, 2009 08:38
Recursively diff two Ruby hashes.
# Recursively diff two hashes, showing only the differing values.
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license.
#
# Example:
#
# a = {
# "same" => "same",
# "diff" => "a",
# "only a" => "a",
# "nest" => {
@Panmind
Panmind / application_helper.rb
Created May 28, 2010 13:10
Zendesk dropbox and remote authentication plugin for Rails -- obsoleted by http://github.com/Panmind/zendesk
### This gist is obsoleted by the full plugin release:
### http://github.com/Panmind/zendesk - check it out :-)
module ApplicationHelper
include PM::Zendesk::Helpers
# .... more helpers ....
end
@rooreynolds
rooreynolds / things_beta_list_completed_tasks.sh
Created March 9, 2012 23:39
Extracting useful data from Things (Cloud beta) via its SQLite database
#Completed tasks (showing their title, start date, completion date and time to complete in days)
sqlite3 -csv -header ~/Library/Application\ Support/Cultured\ Code/Things\ beta/ThingsLibrary.db "SELECT
substr(ZTITLE,0,26) as title,
datetime(ZCREATIONDATE, 'unixepoch', '+31 years', 'localtime') as startdate,
datetime(ZSTOPPEDDATE, 'unixepoch', '+31 years', 'localtime') as completeddate,
round(julianday(datetime(ZSTOPPEDDATE, 'unixepoch', '+31 years', 'localtime')) - julianday
(datetime(ZCREATIONDATE, 'unixepoch', '+31 years', 'localtime')),5) as age
FROM ZTHING WHERE ZSTATUS = 3 ORDER BY completeddate;
@andphe
andphe / gist:3232343
Created August 2, 2012 01:41
Export your links from Safari reading list
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'
@jgoodall
jgoodall / things.sh
Created November 12, 2012 18:33
shell script to print things tasks to the screen (geektool)
#!/bin/bash
# useful for [geektool](http://projects.tynsoe.org/en/geektool/)
# jg: made lib_dir generic
# Title: Things Extract Script for GeekTool
# Author: Alex Wasserman
# Description: Extracts the currents items from Things database, stores in a temp file. Outputs tmp file if Things DB is locked in use.
# Things SQL Library
export SQL_LIBRARY="ThingsLibrary.db"
@kevit
kevit / gist:4986610
Created February 19, 2013 14:58
Safari Reading list to Pocket import script
#!/bin/sh
#http://getpocket.com/import/instapaper
set -x
cat >> /tmp/import.html << "EOF"
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Instapaper: Export</title>
</head>
@olizilla
olizilla / meteor-dump.sh
Last active May 29, 2016 02:18
Dump a mongo db from a live meteor app to a local dump dir.
#!/bin/bash
# __
# _____ ____ _/ |_ ____ ____ _______
# / \ _/ __ \ \ __\_/ __ \ / _ \ \_ __ \
# | Y Y \\ ___/ | | \ ___/ ( <_> ) | | \/
# |__|_| / \___ > |__| \___ > \____/ |__|
# \/ \/ \/
#
# .___
# __| _/ __ __ _____ ______
@kenyee
kenyee / gist:6307258
Last active December 17, 2022 10:38
How to add Node.js npms to your Meteor.js project.
Make a subdirectory named packages/mynpms in your project.
Add a package.js that looks something like this:
Package.describe({
summary: "Custom app NPM dependencies"
});
Npm.depends({
nconf: '0.6.7',
feedparser: '0.16.1'
@RaVbaker
RaVbaker / readme.md
Last active November 29, 2023 06:08
Reverse engineering Things SQLite tasks database

To open SQLite Things.app database run this command in Terminal.app:

$ sqlite3 ~/Library/Containers/com.culturedcode.things/Data/Library/Application\ Support/Cultured\ Code/Things/ThingsLibrary.db

In SQLite command-line type this query to get your tasks stats:

sqlite> .mode column
sqlite> .header on
sqlite> select zscheduler, zstatus, ztrashed, count(*) from ZTHING where z_ent = 13 group by  zstatus,ztrashed order by Z_pk desc;

ZSCHEDULER ZSTATUS ZTRASHED count(*)

@rooreynolds
rooreynolds / voltmeter_things.ino
Last active December 29, 2015 18:49
Things-completed-today-meter
const int voltPin = 4;
const int maxVoltAdjust = 230; // analog out is max 255, but for my voltmeter 230 == 100%
void setup() {
pinMode(voltPin, OUTPUT);
Serial.begin(19200);
}
String inData;