Skip to content

Instantly share code, notes, and snippets.

Dominik Siebel dsiebel

Block or report user

Report or block dsiebel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dsiebel
dsiebel / list_gcp_ipranges.sh
Last active May 7, 2018 — forked from n0531m/list_gcp_iprange.sh
Google Cloud Platform : ip address range
View list_gcp_ipranges.sh
#!/usr/bin/env bash
[[ -v VERBOSE ]] && set -x
set -eu
# This script lists all ip ranges currently used by
# the google cloud platform, according to ns-lookup / dig
# TXT _cloud-netblocks.googleusercontent.com
#
# https://cloud.google.com/compute/docs/faq#ipranges
#
@dsiebel
dsiebel / calendar.html.twig
Created Oct 18, 2013
A Twig template rendering a calendar/datepicker.
View calendar.html.twig
{#
time can be any string acceptable by http://www.php.net/strtotime, the
template will output that time's month.
If you don't want to pass in a date you can set time like this:
{% set time = "now"|date("U") %}
{% set time = "December 2012"|date("U") %}
How ever you want to output items onto the calendar is a different issue,
but I'd assume pushing everything into an array numerically indexed by that day:
@dsiebel
dsiebel / gist:3098374
Created Jul 12, 2012
UK postcode regex
View gist:3098374
(GIR 0AA)|(((A[BL]|B[ABDHLNRSTX]?|C[ABFHMORTVW]|D[ADEGHLNTY]|E[HNX]?|F[KY]|G[LUY]?|H[ADGPRSUX]|I[GMPV]|JE|K[ATWY]|L[ADELNSU]?|M[EKL]?|N[EGNPRW]?|O[LX]|P[AEHLOR]|R[GHM]|S[AEGKLMNOPRSTY]?|T[ADFNQRSW]|UB|W[ADFNRSV]|YO|ZE)[1-9]?[0-9]|((E|N|NW|SE|SW|W)1|EC[1-4]|WC[12])[A-HJKMNPR-Y]|(SW|W)([2-9]|[1-9][0-9])|EC[1-9][0-9]) [0-9][ABD-HJLNP-UW-Z]{2})
@dsiebel
dsiebel / default-80
Created Jul 7, 2012
Apache2 dynamic user home vhosts
View default-80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerAlias home.*.local
DocumentRoot /var/www/default-80
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
@dsiebel
dsiebel / template_store.html
Created Jun 21, 2012
JavaScript Micro-Templating (2008 by John Reisig, mirrored for easy access) http://ejohn.org/blog/javascript-micro-templating/
View template_store.html
<script type="text/html" id="item_tmpl">
<div id="<%=id%>" class="<%=(i % 2 == 1 ? " even" : "")%>">
<div class="grid_1 alpha right">
<img class="righted" src="<%=profile_image_url%>"/>
</div>
<div class="grid_6 omega contents">
<p><b><a href="/<%=from_user%>"><%=from_user%></a>:</b> <%=text%></p>
</div>
</div>
</script>
@dsiebel
dsiebel / gist:2894014
Created Jun 8, 2012
ZSH dotfile by GRML
View gist:2894014
# Filename: /etc/zsh/zshrc
# Purpose: config file for zsh (z shell)
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
################################################################################
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
@dsiebel
dsiebel / StreamingStatementCreator.java
Created Mar 5, 2012
PreparedStatementCreator for streaming java.sql.ResultSets to minimize Memory usage and avoid java.lang.OutOfMemoryErrors
View StreamingStatementCreator.java
package org.springframework.jdbc.core;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.PreparedStatementCreator;
public class StreamingStatementCreator implements PreparedStatementCreator {
@dsiebel
dsiebel / Base64.java
Created Apr 1, 2011
Static encoding / decoding class for Base64
View Base64.java
public class Base64 {
private final static char[] ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray();
private static int[] toInt = new int[128];
static {
for(int i=0; i< ALPHABET.length; i++){
toInt[ALPHABET[i]]= i;
}
@dsiebel
dsiebel / foorealm.xml
Created Mar 30, 2011
Absicherung eines Jetty (standalone) mit Basic Auth
View foorealm.xml
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- =========================================================== -->
<!-- Configure Authentication Login Service -->
<!-- Realms may be configured for the entire server here, or -->
<!-- they can be configured for a specific web app in a context -->
<!-- configuration (see $(jetty.home)/contexts/test.xml for an -->
<!-- example). -->
You can’t perform that action at this time.