Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env zsh
BASE=${0%/*}
SQLITE=/usr/bin/sqlite3
echo "Extracting from OmniFocus"
$BASE/of-store --debug --out=$BASE/finished.db
$BASE/kanban-fetch --debug --out=$BASE/inprogress.db
echo "Exporting to tasks.csv"
// See: https://devforums.apple.com/message/1000934#1000934
import Foundation
// Logic
operator prefix ¬ {}
@prefix func ¬ (value: Bool) -> Bool {
return !value
}
@brwe
brwe / example-queries
Last active September 23, 2017 04:17
Significant terms examples, meetup "elasticsearch switzerland", June 5 2014
# Terms aggregations
POST reuters/_search
# aggregate on places - how many articles per country?
POST reuters-test/_search
{
"size": 0,
"aggregations": {
"class": {
@jkreps
jkreps / benchmark-commands.txt
Last active September 15, 2024 11:37
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@philgruneich
philgruneich / SafariEvernote.bookmarklet.js
Last active February 26, 2024 07:00
Bookmarklet to save articles from the web to Evernote using Safari on iOS
// Credits to Phillip Gruneich, Brett Terpstra and Jonathon Duerig.
// This bookmarklet requires Drafts by Greg Pierce/Agile Tortoise.
javascript:(function()%7Bvar%20request=new%20XMLHttpRequest();request.open(%22GET%22,%22http://heckyesmarkdown.com/go/?read=1&preview=0&showframe=0&output=url&u=%22+encodeURIComponent(location.href),true);request.send();request.onreadystatechange=function()%7Blocation.href=%22drafts://x-callback-url/create?text=%22+request.responseText+%22&action=Markdown%20to%20Evernote%22%7D;%7D)();
// Version without triggering the Markdown to Evernote action on Drafts
javascript:(function()%7Bvar%20request=new%20XMLHttpRequest();request.open(%22GET%22,%22http://heckyesmarkdown.com/go/?read=1&preview=0&showframe=0&output=url&u=%22+encodeURIComponent(location.href),true);request.send();request.onreadystatechange=function()%7Blocation.href=%22drafts://x-callback-url/create?text=%22+request.responseText%7D;%7D)();
@philgruneich
philgruneich / Toggle Invisible Files.scpt
Created March 16, 2014 05:06
Show/Hide invisible files in Finder. Add to ~/Library/Application Support/Launchbar/Scripts to launch from Launchbar.
set stateMent to do shell script "defaults read com.apple.finder AppleShowAllFiles"
if stateMent = "TRUE" then
do shell script "defaults write com.apple.finder AppleShowAllFiles FALSE"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles TRUE"
end if
tell application "Finder" to quit
delay 2
launch application "Finder"
@fractaledmind
fractaledmind / MMDLink
Created February 5, 2014 00:53
Bookmarklet to send webpage title, url, and selected text to Drafts in MMD format
@fractaledmind
fractaledmind / SkimPage2Evernote
Created February 4, 2014 16:09
Append PDFPen url of current Skim Page to selected Evernote note.
property theHome : path to home folder as string
set base1 to POSIX path of theHome & "Copy/"
set base2 to POSIX path of theHome & "Documents/PDFs/"
tell application "Skim"
set pdfTitle to name of document 1
set customurl to "pdfpen:///" & pdfTitle & "?pg="
set notePage to index of current page of document 1
set theURL to customurl & notePage
set filePath to path of document 1
@philgruneich
philgruneich / UpdatePinboardTags.py
Last active July 14, 2020 16:13
UpdatePinboardTags
#coding: utf-8
import console
import keychain
import pickle
login = keychain.get_password('pinboard.in','pythonista')
if login is not None:
user, pw = pickle.loads(login)
else:
@ttscoff
ttscoff / getpinboard.rb
Created December 27, 2013 23:37
Pinboard to Mavericks tags
#!/usr/bin/ruby
##############################################################################
### getpinboard.rb by Brett Terpstra, 2011 <http://brettterpstra.com>
### Retrieves Pinboard.in bookmarks, saves as local .webloc files for
### Spotlight searching.
###
### Optionally adds OpenMeta tags and/or saves page as PDF (see config below)
### Use -r [NUMBER OF DAYS] to reset the "last_checked" timestamp (primarily
### for debugging).
###