Skip to content

Instantly share code, notes, and snippets.

@PawelWitan
PawelWitan / racounter2dayone.sh
Created September 1, 2012 15:59
Import to Day One Journal app from Racounter Application Data Extract
#!/bin/bash
# Uses Day One cli [http://dayoneapp.com/tools/cli-man] and sqlite3
# Expects extract from iPhone backup made by JuicePhone [http://www.addpod.com/juicephone], folder with a device name should be passed as an argument
[ -z "$1" ] && echo "$0: Usage: $0 Device-Name-Exctracted-Folder" && exit 0
[ ! -d "$1" ] && echo "$0: $1 is not a directory" && exit 0
[ ! -e "$1/Application Data/Raconteur/Documents/Entries.sqlite" ] && echo "$0: $1 doesn't contain Racounter app extract." && exit 0
RT="$1"
@mootoh
mootoh / latest_dayone_entry.rb
Created August 29, 2012 07:32
prescript to Automator that extracts the latest Day One journal entry.
#
# See also: https://gist.github.com/3508021
#
require 'rubygems'
require 'sqlite3'
DAYONE_JOURNAL_PATH = "~/Library/Containers/com.dayoneapp.dayone/Data/Library/Application\ Support/Journal.sqlite"
db = SQLite3::Database.new(DAYONE_JOURNAL_PATH)
row = db.execute('select Z_PK, Z_ENT, Z_OPT, ZCREATIONYEAR, ZISENTRYDELETED,ZSTARRED,ZCREATIONDATE, ZMODIFIED,ZPHOTOMODIFIED,ZENTRYTEXT, ZUUID, ZLOCATION, ZWEATHER from ZJOURNALENTRY order by Z_PK DESC limit 1')[0]
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[JBViewController alloc] initWithNibName:@"JBViewController" bundle:nil];
self.window.rootViewController = self.viewController;
// ADD THIS LINE:
[self.window setTransform:CGAffineTransformMakeScale(0.81, 0.81)];
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@jeredb
jeredb / Log to Day One.scpt
Created February 24, 2012 19:26
Based on Brett Terpstra's Log Taskpaper Archives to Day One, except for Omnifocus.
(*
Jered Benoit
jeredb.com
Omnifocus -> Day One Daily Completed Task Log
Based upon [Version 1.0] [1] of [OmniFocus - Weekly Project Report Generator] [2]
Originally Authored by Chris Brogan and Rob Trew
February 5, 2012
@eiszfuchs
eiszfuchs / convert.py
Created August 3, 2011 12:36
convert tweet backup into Day One Journal entries
import os, glob, string
import datetime, calendar
import json, rfc822, plistlib
root = './backup/'
tweet_count = 0
print 'conversion started'
if not os.path.exists('./entries/'):
@bloom
bloom / macjournal_import.rb
Created May 18, 2011 00:27
Import to Day One Journal app from MacJournal Export
require "open3"
def readfile(file)
f = File.open(file)
lines = f.readlines("\n\n\n\n")
lines.each do |line|
fields = line.scan(/\s+Date:\s([^\n]+)$\s+Topic:\s([^\n]+)\n(.*)/m)
date = fields[0][0].strip
@alexpgates
alexpgates / Use DayOne Journal data with php
Created April 6, 2011 20:05
Use DayOne data with php.
<?php
// DayOne is a nice little journaling app for iOS / Mac (available via App Store).
// This code requires php_class_lib available here: https://github.com/jsjohnst/php_class_lib
include('php_class_lib/classes/parsers/plist/PlistParser.inc');
// grab filenames for all of your journal entries
$entries = array();
if ($handle = opendir('/path/to/your/Journal.dayone/entries')) {