Skip to content

Instantly share code, notes, and snippets.

View Pephers's full-sized avatar

Chiel Robben Pephers

View GitHub Profile
@Pephers
Pephers / Default (OSX).sublime-keymap
Created July 11, 2012 12:05
Sublime Text 2 configuration
[
{
"keys": ["super+f"], "command": "show_panel", "args": {"panel": "replace"}
}
]
@Pephers
Pephers / .zshrc
Last active June 29, 2018 09:37
A basic ~/.zshrc configured with some colors, vi mode, and for use with Homebrew. Also shows the current git branch.
export PATH="$(brew --prefix)/bin:$PATH"
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export HISTSIZE=2000
export HISTFILE="$HOME/.history"
export SAVEHIST=$HISTSIZE
setopt hist_ignore_all_dups
setopt hist_ignore_space
@Pephers
Pephers / gist:5203627
Created March 20, 2013 10:15
Git diff colorized outpot
git config --global color.diff always
<script>
(function() {
var forms = document.forms;
function gaTrackPageview(number) {
_gaq.push(['_trackPageview', document.location.pathname + '-form-' + number]);
}
for (var i = 0; i < forms.length; i++) {
@Pephers
Pephers / xmlstarlet-snippets.sh
Last active November 27, 2016 16:11
Update and delete nodes in many XML files
# delete node
find . -name modules.xml | xargs xmlstarlet ed -L -d '//node'
# update attribute
find . -name modules.xml | xargs xmlstarlet ed -L -u '//node/@attr' -v 'value'
# indent with 4 spaces
for i in $(find . -name 'modules.xml'); do xmlstarlet fo -s 4 "$i" > "$i.tmp"; mv "$i.tmp" "$i"; done
@Pephers
Pephers / .tmux.conf
Last active December 20, 2015 19:29
A basic ~/.tmux.conf for the OS X Terminal.app.
set -g default-terminal "screen-256color"
set -g status-bg white
set -g status-fg black
set -g status-left " "
set -g status-right " #(hostname -s) "
set -g set-titles on
set -g set-titles-string "#W"
set -g base-index 1
set -s escape-time 0
@Pephers
Pephers / heredoc-function.php
Last active September 26, 2023 17:55
How to call a PHP function inside a Heredoc.
<?php
$cb = function ($fn) {
return $fn;
};
echo <<<HEREDOC
Hello, {$cb(ucfirst('world'))}
HEREDOC;
.mq-large .service-list__row {
float: left;
display: table;
table-layout: fixed;
width: 66.66%;
padding-right: 0.1875em;
}
.mq-large .service-list__row + .service-list__row {
position: relative;
left: .375em;