Skip to content

Instantly share code, notes, and snippets.

View obstschale's full-sized avatar
🥑
Avocado for the wise.

Hans-Helge Buerger obstschale

🥑
Avocado for the wise.
View GitHub Profile
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="camptix-payfast-gateway"
CURRENTDIR=`pwd`
MAINFILE="camptix-payfast.php" # this should be the name of your main php file in the wordpress plugin
# git config
@obstschale
obstschale / gist:fb1a46ba32ce71cd5bec
Created June 19, 2014 14:35
Kategorisierungsbanner
<p class="beginner-banner" style="
border-color: #5BC0DE;
background: #F4F8FA;
border-left: 3px solid #5BC0DE;
padding: 1em;
font-weight: bold;
color: #5BC0DE;
">Anfänger</p>
<p class="advanced-banner" style="
@obstschale
obstschale / vvv-log
Last active August 29, 2015 14:01
VVV log output
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
Progress: 90%
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: wordpress-vagrant_default_1400506899365_45722
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
@obstschale
obstschale / wget octave
Created February 25, 2014 14:16
Download complete Octave documentation with wget: -k (make links suitable for local viewing) -r (download recursively to get all pages) -np (do not follow parents; stay in 'interpreter')
wget -k -r -np http://www.gnu.org/software/octave/doc/interpreter/
@obstschale
obstschale / levenstein_distance.m
Last active August 29, 2015 13:56
Calculate Levenstein distance using Octave function
%% Levenstein Distance: calculate levenstein distance with matrix
function [distance] = levenstein_distance(x, y, output = 0)
% initialization
ma = zeros( size(y,2)+1, size(x,2)+1 );
ma(1,:) = [0:size(x,2)];
ma(:,1) = [0:size(y,2)];
for i=2:size(ma,1)
for j=2:size(ma,2)
ma(i,j) = min( [ ma(i,j-1)+1, ma(i-1,j)+1, ma(i-1,j-1)+1- (y(i-1)==x(j-1)) ] );
@obstschale
obstschale / dock_separator
Created February 18, 2014 10:08
Adds a separation space in your Mac Dock.
$ defaults write com.apple.dock persistent-apps -array-add '{ "tile-type" = "spacer-tile"; }'
$ killall Dock
@obstschale
obstschale / .inputrc
Created January 31, 2014 09:28
.inputrc controls how programs using the readline library (including bash) behave. It is loaded automatically. For full details see the Function and Variable Index section of the GNU readline manual. Consider the following settings: (src: http://www.zsh.org/mla/users/2006/msg01114.html )
# Ignore case while completing
set completion-ignore-case on
# Make Bash 8bit clean
set meta-flag on
set convert-meta off
set output-meta on
@obstschale
obstschale / zsh-newuser-install
Created January 16, 2014 14:28
start zsh install wizard
The function will not be run in future, but you can run
it yourself as follows:
autoload -Uz zsh-newuser-install
zsh-newuser-install -f
@obstschale
obstschale / bridgePattern.php
Created November 27, 2013 17:09
Bridge Pattern with a Pizza example
<?php
abstract class Pizza {
protected $pizzaria;
function __construct( $impl ) {
$this->pizzaria = $impl;
}
abstract public function getCosts();
abstract public function getRecipe();
@obstschale
obstschale / gist:7661552
Created November 26, 2013 16:37
traceroute -m 60 216.81.59\.173 # Traceroute Wars! Check out these reverse records. https://twitter.com/climagic/status/405373817465602048
traceroute -m 60 216.81.59\.173