Skip to content

Instantly share code, notes, and snippets.

View aurora's full-sized avatar
🤔
...

Harald Lapp aurora

🤔
...
View GitHub Profile
@aurora
aurora / class.lua
Created November 11, 2010 10:51
class implementation for lua
function clone(object)
local dict = {}
local function clone(object)
if (type(object) ~= "table") then
return object
elseif (dict[object]) then
return dict[object]
end
@aurora
aurora / gist:672346
Created November 11, 2010 10:59
inheritance -- Lua style
-- number
number = {}
function number:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
self.__add = function(self, op)
return self:new{value=(self:cast(self) + self:cast(op))}
end
@aurora
aurora / gist:733990
Created December 8, 2010 21:57
Compiling apg on OSX
Compiling apg on OSX
====================
Version: 2.2.3
http://www.adel.nursat.kz/apg/
Makefile
--------
@aurora
aurora / gist:750698
Created December 21, 2010 22:02
mysql backup/restore using CSV files
mysql backup/restore using CSV files
====================================
backup
------
#!/usr/bin/env bash
mysqldump -u root -p... database --no-data > /tmp/backup/database-schema.sql
mysqldump -u root -p... -t -T/tmp/backup database --fields-enclosed-by=\" --fields-terminated-by=,
@aurora
aurora / gist:793108
Created January 24, 2011 11:29
applescript: rename selected itunes tracks
--
-- renames selected tracks
--
-- from:
-- artist: "Various Artists"
-- name: "name-of-artist - name-of-track"
--
-- to:
-- artist: "name-of-artist"
-- album artist: "Various Artists"
<?php
class a {
protected $msg = 'hallo';
function write() { print $this->msg; }
}
class b extends a {
protected $msg = 'world';
function write() { parent::write(); }
@aurora
aurora / sphinx_
Created November 30, 2011 11:48
Munin plugin which monitors Sphinx
#!/bin/bash
=head1 NAME
sphinx - Plugin to monitor various sphinx (searchd) stats
=head1 CONFIGURATION
No configuration
@aurora
aurora / gist:1688703
Created January 27, 2012 13:12 — forked from plu/gist:1688329
johannes.plunien@localhost /tmp$ git clone https://github.com/aurora/Memcached-Munin-Plugin.git
Cloning into Memcached-Munin-Plugin...
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 20 (delta 9), reused 7 (delta 3)
Unpacking objects: 100% (20/20), done.
johannes.plunien@localhost /tmp$ cd Memcached-Munin-Plugin/
johannes.plunien@localhost /tmp/Memcached-Munin-Plugin[master]$ git co -b mattdeboard-master
Switched to a new branch 'mattdeboard-master'
johannes.plunien@localhost /tmp/Memcached-Munin-Plugin[mattdeboard-master]$ git pull https://github.com/mattdeboard/Memcached-Munin-Plugin.git
@aurora
aurora / gist:1751760
Created February 6, 2012 12:01
gettext on osx lion

Problem:

stpncpy.c:34: error: expected declaration specifiers or ‘...’ before numeric constant
stpncpy.c:34: error: expected ‘)’ before ‘!=’ token
stpncpy.c:34: error: expected ‘)’ before ‘?’ token
make[4]: *** [stpncpy.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [all] Error 2

make[2]: *** [all-recursive] Error 1

@aurora
aurora / gist:1752747
Created February 6, 2012 15:43
libreadline on osx
perl -i.bak -p -e \
"s/SHLIB_LIBS=.*/SHLIB_LIBS='-lSystem -lncurses -lcc_dynamic'/g" \
support/shobj-conf
./configure
make
sudo make install