Skip to content

Instantly share code, notes, and snippets.

View allardhoeve's full-sized avatar

Allard Hoeve allardhoeve

View GitHub Profile
@allardhoeve
allardhoeve / jira-template.md
Last active October 7, 2020 14:10 — forked from stefanmaric/copy-to-clipboard-bookmarklet.md
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard

Copy Jira template to browser

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.

This is the base javascript:

(function (text) {
  var node = document.createElement('textarea')
  var selection = document.getSelection()
@allardhoeve
allardhoeve / varnish-4.0
Created February 16, 2016 11:59
/etc/default/varnish
# Configuration file for varnish
#
# This file is stored in ansible
START=yes
NFILES=131072
MEMLOCK=82000
DAEMON_OPTS="-a :6081 \
-p thread_pool_add_delay=2 \
@allardhoeve
allardhoeve / 0001-BUGIFX-Magento-Zend-Framework-1-PHP5.6.patch
Created December 18, 2015 11:43 — forked from renttek/0001-BUGIFX-Magento-Zend-Framework-1-PHP5.6.patch
Bugfix for Zend Framework 1 in Magento (>= 1.7.*.*) + PHP 5.6
From 473846959772d8160b34b92ae3bcecddf24b972f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julian=20Nu=C3=9F?= <[email protected]>
Date: Tue, 23 Sep 2014 21:07:29 +0200
Subject: [PATCH 1/1] [BUGIFX] Zend Framework 1 + PHP5.6
---
lib/Zend/Locale/Format.php | 22 +++++++++++-----------
lib/Zend/Service/Audioscrobbler.php | 6 +++---
lib/Zend/Service/Technorati.php | 6 +++---
lib/Zend/Validate/Hostname.php | 4 ++--
@allardhoeve
allardhoeve / docker-cleanup
Created November 13, 2015 09:21
Clean up all the docker things
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'
@allardhoeve
allardhoeve / scan.py
Last active August 29, 2015 14:22
scan.py
#!/usr/bin/env python
import requests
import argparse
import datetime
import uuid
parser = argparse.ArgumentParser()
parser.add_argument('base_url', type=str, help="The base url of the shop, e.g. http://amsterdamflowers.nl/")
args = parser.parse_args()
package Byte:::Apache2::RewriteURI;
use strict;
use warnings;
use Apache2::RequestRec ();
use Apache2::Const -compile => qw(DECLINED);
sub handler {
my $r = shift;
@allardhoeve
allardhoeve / enable-gnome-keyring.sh
Created February 18, 2014 10:10
Enabling Gnome keyring on XFCE4
sudo perl -pi -e 's/^use-ssh-agent/#use-ssh-agent/g;' /etc/X11/Xsession.options
echo 'if [ -n "$GNOME_KEYRING_PID" ]; then eval `gnome-keyring-daemon --start`; export SSH_AUTH_SOCK; fi' > ~/.xprofile
@allardhoeve
allardhoeve / gist:8298790
Created January 7, 2014 12:44
debootstrap wheezy on ubuntu
```bash
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg --keyserver keyserver.ubuntu.com --recv-keys 6FB2A1C265FFB764
sudo DIST=wheezy ARCH=amd64 git-pbuilder create --mirror=http://ftp.nl.debian.org/debian/
```
class TestNamedTemporaryFile(TestCase):
def setUp(self):
# set up the mock
# you could use ByteTestCase when you are at byte.nl ;)
mockobj = mock.Mock()
patcher = mock.patch("tempfile.NamedTemporaryFile", mockobj)
self.addCleanup(patcher.stop)
patcher.start()