Skip to content

Instantly share code, notes, and snippets.

View larsvegas's full-sized avatar

larsvegas larsvegas

View GitHub Profile
@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"
@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 / 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 / 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 / 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 / rsync-backup.sh
Created February 27, 2013 10:21
remote rsync backup ubuntu ssh
#!/bin/sh
#
# rsync backup a machine remotly
#
# http://ubuntuextreme.blogspot.de/2009/01/how-to-use-rsync-for-backup.html
# https://help.ubuntu.com/community/rsync
@larsvegas
larsvegas / gist:5092000
Last active December 14, 2015 13:18 — forked from lucasfais/gist:1207002

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@larsvegas
larsvegas / stolen-retina-macbook-learnings-security.md
Created April 22, 2013 16:10
What i learned from my stolen Apple MacBook Retina about remote swiping a built in honeypot and data security in general.

What i learned from my stolen Apple MacBook Retina about remote swiping, a built in honeypot and data security in general.

@larsvegas
larsvegas / vimrc-solarized-settings.vim
Created April 23, 2013 10:10
.vimrc-solarized-settings
"" Use a Colorscheme
Bundle 'altercation/vim-colors-solarized'
syntax enable " Turn on syntax highlighting.
"set background=light
set background=dark
set t_Co=256 " 256 colors
"" colorscheme solarized settings
"" optionname defaults
let g:solarized_termcolors=256 " 16 | 256
let g:solarized_termtrans=0 " 0 | 1
@larsvegas
larsvegas / create-kconline-db.sql
Last active December 16, 2015 22:09
create kconline user and databases
-- create database and user kconline
create database kconline;
grant usage on *.* to kconline@localhost identified by "kconline";
grant all privileges on kconline.* to kconline@localhost ;
-- create database and user kconline_test
create database kconline_test;
grant usage on *.* to kconline_test@localhost identified by "kconline_test";
grant all privileges on kconline_test.* to kconline_test@localhost ;