Skip to content

Instantly share code, notes, and snippets.

@mattweber
mattweber / README
Last active December 13, 2015 22:19
Using ElasticSearch To Find The Best Time To Ask Questions on StackOverflow
Use extractDocs.py to parse and index the StackOverflow posts.xml file into an existing index.
Usage: extractDocs.py [options] file
Options:
-h, --help show this help message and exit
-s SERVER, --server=SERVER
ElasticSearch Server
-i INDEX, --index=INDEX
Index name to use
@dpo
dpo / mail2things.scpt
Last active December 13, 2015 20:08
An Automator workflow to add an email from Mail.app to Things' Inbox. This is a modification of http://dl.dropbox.com/u/8019/MailToThings.scpt. Create an Automator Service, start with "Get Selected Mail Messages", then "Run AppleScript" and paste the contents of this gist as script. Subsequently, you can process the list of new todo items. I lik…
on run {input, parameters}
set todoList to {}
repeat with theMessage in input
-- Grab message info.
tell application "Mail"
-- Remove apostrophes from Subject as they wreak havoc.
set AppleScript's text item delimiters to {"'"}
javascript:window.location='drafts://x-callback-url/create?text=%5B'+encodeURIComponent(document.title)+'%5D('+encodeURIComponent(location.href)+')&action=Copy%20to%20Clipboard'
Programming career distilled.
- holy shit programming in language X isn't that hard.
- okay, I have a hammer, everything is a nail.
- holy shit there are other tools that make working even faster.
- I can solve this problem using 3 different tools I know well.
- I'm bored by learning other tools, I solve everything using my favorite tool.
- become a manager.
@collindonnell
collindonnell / Octopress New Post.applescript
Last active December 10, 2015 18:09
Create a new Octopress post from LaunchBar.
(*
Create a new post in Octopress from Launchbar
Author: Collin Donnell
Website: http://collindonnell.com
Date: 01/06/2013
*)
on handle_string(postTitle)
try
@collindonnell
collindonnell / Safari to Pinboard.applescript
Last active March 7, 2017 14:19
Send the frontmost Safari tab to Pinboard using LaunchBar. Separate tags by spaces in LaunchBar's input field.
(*
Send the URL of the Safari tab to Pinboard from LaunchBar
Author: Collin Donnell
Website: http://collindonnell.com
Date: 2013-01-06
Initially based on script for sending Chrome links to Pinboard
using Alfred by Tim Bueno:
http://www.timbueno.com/2012/06/27/pinboard-plus-alfred
@igrigorik
igrigorik / README.md
Last active December 10, 2015 02:48
Home router latency (Linksys E1550) - quick test.

Quick, take a guess, what's the first hop latency to your home wireless router?

Below 1ms, right? Yeah, you wish!

Below are results from a quick test on my home router (Linksys E1550). Some lessons learned:

  • 3-8ms median
  • very different latency tails on different channels (1,6,11)
  • running in mixed mode helps tame the long tails (do it, if you can)
  • all tests on 2.4Ghz, unfortunately E1550 can't do 5Ghz
@mogelbrod
mogelbrod / gist:4266297
Created December 12, 2012 09:13
Vim fold function which does indentation based folding.
function! IndentationFoldExpr(ln) " {{{
let line = getline(a:ln)
if line =~ '^\s*$'
return '-1' "'='
end
let ind = indent(a:ln) / &sw
let ind_next = indent(nextnonblank(a:ln+1)) / &sw
@ChewingPencils
ChewingPencils / rename_pinboard_tag.py
Created November 30, 2012 21:51
Rename Pinboard Tag
#!/usr/bin/env python
# A quick and dirty script to rename a pinboard.in tag.
# I'll probably update this become a proper command line app one day
import urllib2
import pinboard
pinuser = ""
pinpasswd = ""
@Zettt
Zettt / New OmniFocus Task.py
Created November 23, 2012 17:59
New OmniFocus Task
import webbrowser
import urllib
# omnifocus:///add?name=[prompt]&note=[prompt]
omnifocus_url = "omnifocus:///add?"
task_name_url = "name="
note_url = "note="
# input
prompt = "> "