Skip to content

Instantly share code, notes, and snippets.

@halbtuerke
halbtuerke / omnifocus-capture.el
Last active September 1, 2015 08:21 — forked from jrblevin/omnifocus-capture.el
Sending Tasks to OmniFocus from Emacs <http://jblevins.org/log/emacs-omnifocus>
;; Based on omnifocus-capture.el by Ken Case with the following original comment:
;;
;; To capture tasks from Emacs to OmniFocus using Control-C Control-O,
;; drop this script in your emacs load path and add lines like these to
;; your .emacs:
;;
;; (autoload 'send-region-to-omnifocus "omnifocus-capture" "Send region to OmniFocus" t)
;; (global-set-key (kbd "C-c C-o") 'send-region-to-omnifocus)
;;
;; The send-region-to-emacs function has been rewritten as follows:
@halbtuerke
halbtuerke / gist:5850c411498421865632
Created February 21, 2015 19:09 — forked from kiding/gist:589242021df49eb17be3
UTM Stripper Bookmarklet
javascript:(function()%7Bvar%20e%3Dwindow.location.href%3Bvar%20t%3De.indexOf(%22%3F%22)%3Bif(e.indexOf(%22utm_%22)%3Et)%7Bvar%20n%3De.replace(%2F(%5B%3F%26%5Dutm_(source%7Cmedium%7Cterm%7Ccampaign%7Ccontent)%3D%5B%5E%26%23%5D%2B)%2Fig%2C%22%22)%3Bif(n.charAt(t)%3D%3D%3D%22%26%22)%7Bn%3Dn.substr(0%2Ct)%2B%22%3F%22%2Bn.substr(t%2B1)%7Dif(n!%3De)%7Bhistory.replaceState(null%2Cnull%2Cn)%7D%7D%7D)();
# Usage:
# [sudo] gem install mechanize
# ruby tumblr-photo-ripper.rb
require 'rubygems'
require 'mechanize'
# Your Tumblr subdomain, e.g. "jamiew" for "jamiew.tumblr.com"
site = "doctorwho"
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)

Save books out of Safari Books Online

From http://objectivesea.tumblr.com/post/9033067018/safaribooks

This is hard. I spent way too much time figuring this out, because I was annoyed that a book I bought (Addison-Wesley) was available online for free, except only for 45 days after which payment was required. So I made this hack... probably useful to no one else, but here it is.

Requirements:

  1. iPad.
  2. Safari To Go (the Safari Books Online iPad app).
#!/bin/bash
# Runs the specified command (provided by the first argument) in all tmux panes
# for every window regardless if applications are running in the terminal or not.
function execute_in_all_panes {
# Notate which window/pane we were originally at
ORIG_WINDOW_INDEX=`tmux display-message -p '#I'`
ORIG_PANE_INDEX=`tmux display-message -p '#P'`
@halbtuerke
halbtuerke / sort1mb.cpp
Created October 27, 2012 07:59 — forked from preshing/sort1mb.cpp
Sort one million 8-digit numbers in 1MB RAM
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef unsigned int u32;
typedef unsigned long long u64;
//-------------------------------------------------------------------------
// WorkArea
//-------------------------------------------------------------------------
@halbtuerke
halbtuerke / O'Reilly-Fringes-Of-Git-Webinar.markdown
Created October 27, 2012 06:49 — forked from matthewmccullough/O'Reilly-Fringes-Of-Git-Webinar.markdown
Matthew McCullough & Tim Berglund's O'Reilly "Fringes Of Git" Webinar Source

O'Reilly Git Webinar

The Fringes of Git

Overview

Matthew McCullough and Tim Berglund, authors of the O'Reilly Git Master Class videos will introduce you to the very edges of Git's capabilities. There are plenty of "Getting Started with Git" sessions on the web, but we'd like to take 40 minutes of your time in an entirely different direction. These 40 minutes will primarily be live coding with a few diagrams for reference. We'll show you how Git reaches farther than any other version control system to provide capabilities for both the novice and the master craftsperson.

Webinar Outline

Rebasing

@halbtuerke
halbtuerke / caret-hint.js
Created September 24, 2012 04:35 — forked from stepnem/caret-hint.js
Pentadactyl plugin for moving caret position and/or selecting text by hinting
/* NEW BSD LICENSE {{{
Copyright (c) 2009-2011, anekos.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
// ==UserScript==
// @name Straight Google
// @id straight_google_pokerface
// @namespace in.co.tossing.toolkit.google
// @description Remove URL redirection from google products
// @license GPL v3 or later version
// @updateURL http://userscripts.org/scripts/source/121261.meta.js
// @include *://www.google.*/*q=*
// @include *://www.google.*/*tbs=*
// @include *://www.google.*/search?*