Skip to content

Instantly share code, notes, and snippets.


Tom von Schwerdtner tvon

View GitHub Profile
tswicegood / sync_things.rb
Created Oct 1, 2009
Simple Ruby script to sync Basecamp and Things to-dos.
View sync_things.rb
#!/usr/bin/env ruby
# Biggest problem with this is that it checks everything. Needs
# to be adjusted to only check N days and/or N tasks on Basecamp.
# Also has a problem in that Completed always wins. If you have a
# task marked at completed, then mark it as open again on just one
# side, it'll mark the other as completed if you run the sync again.
# All that said, it provides a basic, very rudimentary sync.
jordansissel /
Created Jul 6, 2011
Sorting windows in tmux by hostname.

For this to work, it requires my tmux fork that includes what I use as the hostname in the window list.

At any rate, it'll sort my tmux sessions alphabetically by the host I'm using.

my tmux fork:

Starts with:

(0) -    nightfall: zsh - /home/jls/projects/tmux/trunk                                                            

(1) carrera: screen -x irc

danivovich / main.rb
Created Oct 11, 2011
Pivotal feature points by label
View main.rb
require 'pivotal-tracker'
def estimate_to_hours(estimate)
2 ** estimate
PivotalTracker::Client.token = TOKEN
skeeet /
Created Apr 12, 2012 — forked from MaximKeegan/
Create a RAM disk for using with XCode
# Create a RAM disk with same perms as mountpoint
# Script based on with some additions
# Usage: sudo ./ start
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

quiver /
Last active Jun 27, 2022
Who says PostgreSQL can't Pub/Sub like Redis?

Pub/Sub pattern with PostgreSQL's LISTEN/NOTIFY command

This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.


publish message to foo channel from user nickname.

$ python foo nickname
PUBLISH to channel #foo
coldnebo / rails_trace.rb
Last active Dec 1, 2018
This Rack middleware for Rails3 lets you see a call-trace of the lines of ruby code in your application invoked during a single request. Only code within your app is considered (i.e. in the /app folder). This expands on my previous attempt ( Example of output in comments below.
View rails_trace.rb
require 'singleton'
# outputs a colored call-trace graph to the Rails logger of the lines of ruby code
# invoked during a single request.
# Example:
# 1) Make sure this file is loaded in an initializer
# 2) Add the following to your application.rb in Rails3:
4ndrej /
Last active Aug 10, 2022
Test of java SSL / keystore / cert setup. Check the comment #1 for howto.
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
public class SSLPoke {
mattt /
Last active Aug 20, 2022
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
sburlot /
Created Mar 8, 2014
Creates a ramdisk and start Xcode with the DerivedData stored in ramdisk. Also deletes the ramdisk and reset Xcode prefs.
# Creates a ramdisk and start Xcode with the DerivedData stored in ramdisk. Also deletes the ramdisk and reset Xcode prefs.
# - creates a ramdisk, set Xcode DerivedData to this disk and start Xcode.
# - umount a ramdisk, set Xcode DerivedData to default
# Stephan Burlot, Coriolis Technologies,
# based on Alex Shevchenko script (
# based on Diego Freniche script (