Skip to content

Instantly share code, notes, and snippets.

View davidfuhr's full-sized avatar

David Fuhr davidfuhr

  • esentri AG
  • Karlsruhe, Germany
View GitHub Profile
@davidfuhr
davidfuhr / gist:9364795
Last active October 28, 2019 11:08
git snippets
# delete all local merged branches with no activity within the last week
for k in $(git branch --merged | sed /\*/d); do
if [ -z "$(git log -1 --since='1 week ago' -s $k)" ]; then
echo git branch -d $k
fi
done
# delete all merged remote branches with no activity within the last month
for k in $(git branch -r --merged | cut -d ' ' -f3 | sed /\*/d); do
if [ -z "$(git log -1 --since='1 month ago' -s $k)" ]; then
@davidfuhr
davidfuhr / gist:7673553
Last active December 29, 2015 12:49
Finds zero datetime values in a mysql database
-- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- --------------------------------------------------------------------------------
DELIMITER $$
CREATE PROCEDURE `select_zero_date_columns`()
BEGIN
DECLARE current_table_name CHAR(255);
DECLARE current_column_name CHAR(255);
@davidfuhr
davidfuhr / php-install.sh
Last active December 18, 2015 17:59
A php install script for debian using the http://cr.yp.to/slashpackage.html directory structure. To install php 5.3.23 run "php-install.sh 5.3.23"
#!/bin/bash
PHPVERSION=$1
if [[ ! $1 =~ ^5\.[234]\.[0-9]{1,2}$ ]]; then
echo $PHPVERSION is not a valid php version.
exit
fi
INSTALL_PACKAGES=""
for PACKAGE in build-essential bzip2 gcc libbz2-dev libcurl3-openssl-dev libcurl4-openssl-dev libgd2-xpm-dev libicu-dev libmcrypt-dev libmhash-dev libmysqlclient-dev libxml2-dev libxslt1-dev libxslt1-dev make wget; do
.myform {
$label-width: 80px;
.form-horizontal .control-label {
width: $label-width;
}
.form-horizontal .controls {
margin-left: $label-width + 20px;
}
}
@davidfuhr
davidfuhr / gist:3270651
Created August 6, 2012 04:47 — forked from anonymous/gist:3260973
Dump all Session Related PHP ini Values
<?php
$ini = ini_get_all('session', false);
$ini['url_rewriter.tags'] = ini_get('url_rewriter.tags');
foreach($ini as $k => $v)
{
echo $k . ' = ' . $v . "\n<br/>\n";
}