Skip to content

Instantly share code, notes, and snippets.

View hinrik's full-sized avatar

Hinrik Örn Sigurðsson hinrik

View GitHub Profile
@mdo
mdo / 00-intro.md
Last active November 23, 2024 01:11
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@kaspergrubbe
kaspergrubbe / gist:5040161
Created February 26, 2013 17:07
Stackscript
#!/bin/bash
# <UDF name="HOSTNAME" Label="server hostname" default="linode"/>
###########################################################
# System
###########################################################
function system_update {
apt-get update
apt-get -y install aptitude
@daurnimator
daurnimator / Makefile
Created June 20, 2012 08:50
Add utf8 locale to lpeg using ICU (from the C side)
LIBNAME = lpeg_utf8
OUT = $(LIBNAME).so
LUADIR = /usr/include/lua5.1/
LPEGDIR = ../lpeg-0.10.2/
CFLAGS = -O2 -fpic --pedantic -I$(LUADIR) -I$(LPEGDIR)
CC = gcc
$(OUT): lpeg_utf8.o
@perky
perky / ProFi.lua
Created May 30, 2012 20:32
ProFi, a simple lua profiler that works with LuaJIT and prints a pretty report file in columns.
--[[
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php.
Example:
ProFi = require 'ProFi'
ProFi:start()
some_function()
another_function()
coroutine.resume( some_coroutine )
ProFi:stop()
@hinrik
hinrik / flac2mp3
Created June 2, 2010 00:21
Encode FLAC files into properly tagged MP3 files
#!/usr/bin/env perl
use strict;
use warnings;
use File::Spec::Functions qw(catfile splitpath);
use File::Which;
use Getopt::Long qw(:config auto_help);
use List::Util qw(first);
use Pod::Usage;
use String::ShellQuote;
@IcyMidnight
IcyMidnight / MySQL functions to convert between binary and string uuids
Created July 31, 2009 09:27
MySQL functions to convert between binary and string uuids
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
|