This is an example of the power of the D3 library and how you can use the drag behavior of D3 to control the position and shape of the SVG element.
DELIMITER | | |
CREATE FUNCTION uuid_from_bin(b BINARY(16)) | |
RETURNS CHAR(36) DETERMINISTIC | |
BEGIN | |
DECLARE hex CHAR(32); | |
SET hex = HEX(b); | |
RETURN CONCAT(LEFT(hex, 8), '-', MID(hex, 9,4), '-', MID(hex, 13,4), '-', MID(hex, 17,4), '-', RIGHT(hex, 12)); | |
END | |
| |
#!/usr/bin/env python | |
# | |
# udp_hole_punch_tester.py - UDP Hole Punching test tool | |
# | |
# Usage: udp_hole_punch_tester.py remote_host remote_port | |
# | |
# Run this script simultaneously on 2 hosts to test if they can punch | |
# a UDP hole to each other. | |
# | |
# * remote_port should be identical on 2 hosts. |
/* | |
* | |
* The DbUnit Database Testing Framework | |
* Copyright (C)2002-2004, DbUnit.org | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either | |
* version 2.1 of the License, or (at your option) any later version. | |
* |
I'm a fan of MiniTest::Spec. It strikes a nice balance between the simplicity of TestUnit and the readable syntax of RSpec. When I first switched from RSpec to MiniTest::Spec, one thing I was worried I would miss was the ability to add matchers. (A note in terminology: "matchers" in MiniTest::Spec refer to something completely different than "matchers" in RSpec. I won't get into it, but from now on, let's use the proper term: "expectations").
Let's take a look in the code (I'm specifically referring to the gem, not the standard library that's built into Ruby 1.9):
# minitest/spec.rb
module MiniTest::Expectations
# This goes in config/locales/en.rb (*not* en.yml) | |
{ | |
:en => { | |
:time => { | |
:formats => { | |
:full => lambda { |time, _| "%H:%M | %A, #{time.day.ordinalize} %B %Y" } | |
} | |
} | |
} | |
} |
I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).
In Vim I have key bindings C-h/j/k/l
set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W
.) I'd like to use the same keystrokes for switching tmux panes.
An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\
.
Here's how it should work:
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: btsync | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Should-Start: $network | |
# Should-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Multi-user daemonized version of btsync. |
class @GoogleAnalytics | |
@load: -> | |
# Google Analytics depends on a global _gaq array. window is the global scope. | |
window._gaq = [] | |
window._gaq.push ["_setAccount", GoogleAnalytics.analyticsId()] | |
# Create a script element and insert it in the DOM | |
ga = document.createElement("script") | |
ga.type = "text/javascript" |
#! /bin/bash | |
# | |
# do a quick check if there are new messages in a gmail account | |
# | |
# based on: http://cpbl.wordpress.com/2011/11/16/how-to-alpine-maildir-offlineimap/ | |
# | |
# Gaute Hope / 2013-12-13 / [email protected] | |
# | |
# requires: curl | |
# |