Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# encoding: utf-8
begin
require 'curb'
rescue LoadError
puts "This utillity depends on the curb library. (gem install curb)"
exit 1
end
max = ARGV.map{ |p| File.basename p }.map(&:length).max
#!/bin/bash
OSD=true # Notify when the screenshot has been uploaded (requires imagemagick and libnotify)
name="`date +%s`.png" # The local file name of the screenshot
function save {
case "$1" in
selection)
`scrot -bs /tmp/$name 2> /dev/null`
;;
<?php
$row = FALSE;
// show the first row in the table.
print "<tr>
<td colspan=\"3\" class=\"sechead\"><span>C</span>ontact <span>I</span>nfo</td>
</tr>";
// now foreach the bastards array...
foreach($contactArray as $key=>$value) {
if ($value == NULL || $key == "user_id" || $key == "pc_id" || trim($value) == "")
continue;
#!/usr/bin/env ruby
# encoding: utf-8
oldrev, newrev, refname = gets.split
repository = File.expand_path($0)[/([^\/]*?)\.git/]
refs, type, name = refname.split ?/
# encoding: utf-8
module Grooveshark
module Players
class MPlayer
attr_accessor :stream
def initialize stream = nil
@stream = stream
@streaming = false
set source to POSIX path of "/tmp/it.metabox.png"
do shell script "screencapture -i " & source
tell application "Finder"
if exists source as POSIX file then
set response to do shell script "curl -F file=@" & source & " metabox.it"
if response starts with "http" then
set the clipboard to response & ".png"
#include <iostream>
void blablabla();
using namespace std;
int main() {
blablabla();
cin.get();
return 0;
#!/usr/bin/env ruby
# encoding: utf-8
require 'socket'
DefaultHost = 'dpmaster.deathmask.net'
DefaultPort = 27950
ChunkSize = 2**16
UDPSocket.new.tap do |socket|
#!/usr/bin/env ruby
# encoding: utf-8
require 'json'
require 'net/http'
module Google
class Location
def self.search address
new(mac: address).search
@mkroman
mkroman / Ulla
Created January 10, 2011 20:19 — forked from Elevina/Ulla
#!/usr/bin/env ruby
# encoding: utf-8
require 'pulse'
Pulse.connect hostname: 'uplink.io', nickname: 'Ulla2' do
catch :connection_ready do
join "#uplink"
end