Skip to content

Instantly share code, notes, and snippets.

View DASPRiD's full-sized avatar

Ben Scholzen DASPRiD

View GitHub Profile
@DASPRiD
DASPRiD / gist:f069cfba9cd223726280
Created October 7, 2014 18:00
MPD script for HexChat
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import hexchat
__module_name__ = "MPD Status"
__module_version__ = "0.0.1"
__module_description__ = "Sends MPD status"

Keybase proof

I hereby claim:

  • I am dasprid on github.
  • I am dasprid (https://keybase.io/dasprid) on keybase.
  • I have a public key whose fingerprint is D9C9 EBCB 95D3 1CB5 BBE4 08F0 970E 1463 AFB4 67FB

To claim this, I am signing this object:

@DASPRiD
DASPRiD / text.php
Last active August 29, 2015 13:59 — forked from bakura10/text.php
<?php
$routes = [];
if ($_SERVER['ENV'] === 'production') {
$options = ['hostname' => 'connect.mysite.com', 'secure' => true];
} else {
$options = ['hostname' => 'connect.localhost.com'];
}
#!/bin/bash
# Timelapse script by Ben Scholzen 'DASPRiD'
# Licensed under the Simplified BSD License
# http://opensource.org/licenses/BSD-2-Clause
FFPROBE=/usr/bin/ffprobe
FFMPEG=/usr/bin/ffmpeg
SOXI=/usr/bin/soxi
SPLASH_LENGTH=5
#!/bin/bash
CARD_INDEX=0
PROFILE_SPEAKERS='output:iec958-stereo'
PROFILE_HEADPHONES='output:analog-stereo'
CURRENT_PROFILE=$(LANG=C \
pactl list cards \
| grep -E '^Card #|Active Profile:' \
| sed ':a;N;$!ba;s/\(Card #[0-9]*\)\n/\1: /g' \
From 81d9e159d2bd5bffbf573a9c502e96be9df9311a Mon Sep 17 00:00:00 2001
From: Ben Scholzen <mail@dasprids.de>
Date: Fri, 1 Nov 2013 01:03:12 +0100
Subject: [PATCH] Add chunk decoding (hard-coded for now, should be
header-dependent)
---
src/Sslurp/MozillaCertData.php | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
@DASPRiD
DASPRiD / Tweets
Created October 27, 2013 19:33
Collection of accident tweets.
Ben Scholzen ‏@DASPRiD 1 Sep 11
Just had a bike crash with a car :(
Ben Scholzen ‏@DASPRiD 1 Sep 11
@cogocogo I were on the bike, yes. Head wound and something on the arm broken
Ben Scholzen ‏@DASPRiD 1 Sep 11
@sprunka already in the hospital
Ben Scholzen ‏@DASPRiD 1 Sep 11
@DASPRiD
DASPRiD / gist:6126256
Last active December 20, 2015 11:49
Prepending a route programatically.
<?php
$statusRoute = $routeStack->getRoute('status');
$versionRoute = new Segment('/v:version');
$chainRoute = new Chain(array($versionRoute, $statusRoute), $routeStack->getRoutePluginManager(), null);
$routeStack->removeRoute('status'); // Not really required, as addRoute() will override this anyway… just for completeness.
$routeStack->addRoute('status', $chainRoute);
<?php
$locale = 'en-US';
$formatter = new IntlDateFormatter($locale, null, null, null, null, 'MMMM');
$date = new DateTime('1970-01-01');
$monthNames = array();
for ($monthNo = 1; $monthNo <= 12; $monthNo++) {
$monthNames[] = $formatter->format($date);
$date->modify('+1 month');