Skip to content

Instantly share code, notes, and snippets.

@thomaspuppe
thomaspuppe / .bashrc
Last active August 29, 2015 14:06
bash config file
# NOTE: This shit is mixed up (Ubuntu Linux vs Mac OS)
# ######################################
# Functions and Parameters for Own Aliases
# ######################################
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@thomaspuppe
thomaspuppe / formatDateObject.js
Created September 25, 2014 14:21
Format a JS Date Object according toa given String
/* *****************************************************************************
* Formates a JS Date Object according toa given String. The Place holders
* work like the php date() function, but not every case is implemented !
*
* %d% Day of the month, 2 digits with leading zeros
* %j% Day of the month without leading zeros
* %m% Numeric representation of a month, with leading zeros
* %n% Numeric representation of a month, without leading zeros
* %Y% A full numeric representation of a year, 4 digits
* %y% A two digit representation of a year

Automatisches Erstellen von Sitemaps unter UNIX:

wget --mirror --no-parent --reject jpg,jpeg,png,gif,svg,mp3,mp4,JPG,pdf,PDF,woff,eof,eot,ttf --output-file=ran-wget.log http://www.ondigo.de/ 

tree | grep -v index.html

@thomaspuppe
thomaspuppe / keybase.md
Created February 27, 2015 00:04
keybase.md

Keybase proof

I hereby claim:

  • I am thomaspuppe on github.
  • I am thomaspuppe (https://keybase.io/thomaspuppe) on keybase.
  • I have a public key whose fingerprint is 636B DFB4 0A93 BFD8 6EB4 1B3B B1FE FCA7 6B38 ECA6

To claim this, I am signing this object:

@thomaspuppe
thomaspuppe / gist:a6580f7891cde71254b3
Created April 16, 2015 15:43
Log-Analyse in der Konsole

Log-Analyse

Kopieren und verbinden

$ scp user@1.2.3.4:/var/log/apache/www.domain.com.log ~/2015-04-16_log-analyse/www1.domain.com.log
$ scp user@1.2.3.4:/var/log/apache/www.domain.com.log ~/2015-04-16_log-analyse/www2.domain.com.log

$ cd ~/2015-04-16_log-analyse

$ grep "2015-04-16 15" www1.domain.com.log > www.domain.com_1500-1559.log

@thomaspuppe
thomaspuppe / mac-setup
Created June 4, 2015 12:24
Mac Setup
Currently just a collection of snippets, but should be developed into a setup Script!
# Make Sublime available from the command line (sublime ~/.hgrc)
$ sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime
(function( vjs ) {
var webtrekkPlugin = function( options ) {
var player = this,
sendEventToWebtrekk = function( trekkString ) {
var messageData = {
'sender': 'videojsWebtrekk',
'message': trekkString
};
window.parent.postMessage( JSON.stringify( messageData ), '*' );
@thomaspuppe
thomaspuppe / gist:3163220
Created July 23, 2012 11:48 — forked from madrobby/gist:3161015
detect retina support
function isRetina(){
return (('devicePixelRatio' in window && devicePixelRatio > 1) ||
('matchMedia' in window && matchMedia("(-moz-device-pixel-ratio:1.0)").matches))
}
@thomaspuppe
thomaspuppe / .htaccess
Created November 6, 2012 11:25
.htaccess Redirect for folders, preserving subfolders
### Redirect for folders, preserving subfolders
RedirectMatch 301 ^/en/orchester/mitglieder/musiker/(.*) /en/orchestra/musician/$1
RedirectMatch 301 ^/orchester/mitglieder/musiker/(.*) /orchester/musiker/$1
@thomaspuppe
thomaspuppe / php.ini
Created December 19, 2012 11:40
Error Logging bei Mittwald-Projekten
# /etc/php/php.ini
log_errors = On
error_log = /tmp/php-error.log