Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander Dormann alexdo

View GitHub Profile
@alexdo
alexdo / schema.sql
Created May 14, 2016
PowerDNS/Poweradmin/Pdnsmanager SQL Schema
View schema.sql
-- Create syntax for TABLE 'comments'
CREATE TABLE `comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`domain_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`type` varchar(10) NOT NULL,
`modified_at` int(11) NOT NULL,
`account` varchar(40) NOT NULL,
`comment` mediumtext NOT NULL,
PRIMARY KEY (`id`),
@alexdo
alexdo / hubic-wrapper.sh
Last active Aug 29, 2015
omv-hubic-wrapper
View hubic-wrapper.sh
#!/bin/bash
HUBIC="/usr/bin/hubic"
USER="MY_USERNAME"
SESSION_ADDR_FILE="/home/USERNAME/.dbus-session-addr"
SESSION_PID_FILE="/home/USERNAME/.dbus-pid"
HUBIC_STATE=""
DBUS_EXISTS=0
@alexdo
alexdo / Auc-Advanced.lua
Created Aug 1, 2014
The Consortium AH Snatch List for Auctioneer
View Auc-Advanced.lua
["24300:0:0"] = {
["price"] = 12500000,
["link"] = "|cff0070dd|Hitem:24300:0:0:0:0:0:0:0:0:0:0|h[Pattern: Cloak of Eternity]|h|r",
},
["4624:0:0"] = {
["price"] = 165000000,
["link"] = "|cffffffff|Hitem:4624:0:0:0:0:0:0:0:0:0:0|h[Recipe: Lesser Stoneshield Potion]|h|r",
},
["23628:0:0"] = {
@alexdo
alexdo / city_council_election_districts.geojson
Last active Aug 29, 2015
GeoJSON districts for the election of Monheim am Rhein's city council 2014
View city_council_election_districts.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexdo
alexdo / grit-gpg.patch
Created Mar 25, 2013
Unbreak GPG signed commits in mojombo/grit
View grit-gpg.patch
From ece98ab701a181c87dd288f7853ebea18f02ee08 Mon Sep 17 00:00:00 2001
From: Alexander Dormann <alexdo@alexdo.de>
Date: Mon, 25 Mar 2013 16:12:46 +0100
Subject: [PATCH] Strip GPG lines from commit
---
lib/grit/commit.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/grit/commit.rb b/lib/grit/commit.rb
@alexdo
alexdo / 00_build-augeas-homebrew.sh
Last active Apr 22, 2016
Build augeas 1.0.0 from source into Homebrew. Tested under OS X 10.8. Somewhat replaces the augeas formula.
View 00_build-augeas-homebrew.sh
brew install bison flex readline libxml2 autoconf automake
brew link readline --force
brew link bison --force
brew link libxml2 --force
brew link flex --force
bash -c '
git clone git@github.com:lutter/augeas.git /tmp/augeas
cd /tmp/augeas
@alexdo
alexdo / check_freshclam.rb
Created Feb 1, 2013
Nagios ClamAV signature check. Parses the output of freshclam -V
View check_freshclam.rb
#!/usr/bin/env ruby
require 'date'
state = {
:ok => 0,
:warning => 1,
:critical => 2,
:unknown => 3
}
@alexdo
alexdo / mod_search.js
Created Jan 23, 2013
kag-langenfeld.de expanding search field
View mod_search.js
(function($) {
$(document).ready(function() {
$('#mod-search-searchword')
.css({width: '50px'})
.val('')
.focus(function() {
$(this).animate({
width: '175px',
opacity: '.9'
}, 1200);
@alexdo
alexdo / relative_date.php
Created Dec 7, 2012
PHP: Relative timedelta in the future
View relative_date.php
<?php
function myDate( $time, $AllValues=true ) {
$elapsed = floor($time) - time();
if ($elapsed < 1) { return 'Heute'; }
elseif ($elapsed < 24 * 60 * 60) { return 'Morgen'; }
elseif ($elapsed < 2 * 24 * 60 * 60) { return 'Übermorgen'; }
$times = array (
12 * 30 * 24 * 60 * 60 => array('Jahr', 'Jahren'),
30 * 24 * 60 * 60 => array('Monat', 'Monaten'),
@alexdo
alexdo / gist:3964401
Created Oct 27, 2012
test::unit freedom for rails projects
View gist:3964401
From: Alexander Dormann <alexdo@alexdo.de>
Date: Sat, 27 Oct 2012 13:49:40 +0200
Subject: [PATCH] Remove this Test::Unit crap.
---
config/application.rb | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/config/application.rb
+++ b/config/application.rb
You can’t perform that action at this time.