Skip to content

Instantly share code, notes, and snippets.

View larsvegas's full-sized avatar

larsvegas larsvegas

View GitHub Profile
@larsvegas
larsvegas / mysql-dump-structure-data.sh
Last active March 18, 2019 09:38
mysqldump structure and data in seperate files
#!/bin/sh
MYSQLDUMP=`which mysqldump`
HOST=$1
DATABASE=$2
USER=$3
PASS=$4
DATE=`date -u +"%Y%m%d_%H%M%Z"`
@larsvegas
larsvegas / time_entries.sql
Created December 9, 2012 14:12
time_entries
SELECT
DATE_FORMAT(te.spent_on, '%d.%m.%y') AS Datum,
"" AS Von,
"" AS Bis,
REPLACE(FORMAT(te.hours,2),'.',',') AS Menge,
COALESCE (
NULLIF(cfv.value,''),
NULLIF(cfv2.value,''),
NULLIF(cfv3.value,'')
)
@larsvegas
larsvegas / xdebug.php.ini
Created September 19, 2012 15:25
xdebug php.ini default config
xdebug.auto_trace=1
;;Type: boolean, Default value: 0
;;When this setting is set to on, the tracing of function calls will be enabled just before the script is run. This makes it possible to trace code in the auto_prepend_file.
xdebug.cli_color=1
;;Type: integer, Default value: 0, Introduced in Xdebug 2.2
;;If this setting is 1, Xdebug will color var_dumps and stack traces output when in CLI mode and when the output is a tty. On Windows, the ANSICON tool needs to be installed.
;;If the setting is 2, then Xdebug will always color var_dumps and stack trace, no matter whether it's connected to a tty or whether ANSICON is installed. In this case, you might end up seeing escape codes.
;xdebug.collect_assignments=0
@larsvegas
larsvegas / git_svn_prompt.sh
Created June 19, 2012 19:38
git_svn_prompt.sh
## Prompt
## repository highlights and prompt
parse_git_dirty() {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
parse_git_branch() {
git branch 2> /dev/null | sed -e "/^[^*]/d" -e "s/* \(.*\)/(git:\1$(parse_git_dirty))/"
}
parse_svn_branch() {
@larsvegas
larsvegas / gl.sh
Created May 25, 2012 12:16
git log in a pretty format
#!/bin/sh
GIT=`which git`
$GIT log --graph --pretty="%d %Cred %H %Creset %aD %Cgreen %aN %Creset %s"