Skip to content

Instantly share code, notes, and snippets.

View DASPRiD's full-sized avatar

Ben Scholzen DASPRiD

View GitHub Profile

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 / 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"
<?php
$intVector = Vector<int>(53, 32, 43);
$stringVector = Vector<string>('foo', 'bar', 'baz');
$arrayVector = Vector<array>(array('a'), array('b'));
$vectorVector = Vector<Vector<int>>(Vector<int>(1, 2), Vector<int>(2, 3));
$classVector = Vector<\stdClass>(new \stdClass(), new \stdClass());
foreach ($intVector as $key => $value) {
// Do something.
}
#!/bin/bash
if [ -z "$1" ]
then
echo "No input file supplied"
fi
convert $1 \
-trim -resize 512x512 \
\( -clone 0 -background white -shadow 100x2+0+0 -channel A -level 0,5% +channel \) \
#!/usr/bin/env python
from __future__ import division
from gimpfu import *
import math
from array import array
def python_telegram_sticker(timg, tdrawable):
timg.undo_group_start()
From 7c0d660519a9c9a17c03a2cb53d579f66b35469c Mon Sep 17 00:00:00 2001
From: Ben Scholzen <mail@dasprids.de>
Date: Sun, 10 Jan 2016 20:14:00 +0100
Subject: [PATCH] Add feature to show editing time of a document in the
document information dialog
---
krita/ui/KisDocument.cpp | 31 ++++++++++++++++++++++++++++++-
krita/ui/KisDocument.h | 2 ++
libs/odf/KoDocumentInfo.cpp | 3 ++-
{
"#zftalk": {
"zf2 flowchart": "https://docs.google.com/a/rmauger.co.uk/drawings/d/1OwFfjgaiXDuKmS2I8nnJNFqoDgEWNNB-_-tUXUPVrgQ/edit"
},
"global": {
"doesn't work": "Doesn't work is not a helpful statement. Was there an error? Unexpected results? Does it sit on the couch all day eating all your cheetos and ignoring the classifieds? Be specific!",
"espresso": "A coffee beverage which weierophinney and DASPRiD will never reach an agreement on how it should be brewed. (but, really, weierophinney is correct)",
"surveying": "If you have to ask \"Does anyone here use foo\" or \"Are there any baz experts around\" you're just taking a survey. You'll likely get an answer quicker if you just ask specifically what you need help with.",
"zend": "Please stop calling the product by the company name. The product name is Framework, marketed by Zend. Since you don't call the popular operating system Microsoft, call the product Zend Framework or ZF for short. (And yes, y
@DASPRiD
DASPRiD / currently-in.php
Created September 13, 2017 19:37
Idea for having default instances of a class available, lazy-loaded.
<?php
final class Timezone
{
private static $utc;
public static function utc() : self
{
return self::$utc ?: self::$utc = new self('utc');
}
}
public static function getCountryOptions(string $locale) : array
{
$resourceBundle = ResourceBundle::create($locale, 'ICUDATA-region');
$options = [];
foreach ($resourceBundle['Countries'] as $countryCode => $label) {
if (!preg_match('(^[A-Z]{2}$)', $countryCode) || 'ZZ' === $countryCode) {
continue;
}
<?php
declare(strict_types = 1);
namespace Project\Infrastructure\Pdf;
use Project\Infrastructure\Pdf\Exception\FopException;
final class PdfGenerator
{
/**