Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@chelmertz
chelmertz / google.xml
Created October 19, 2011 11:14
Webinject testcase
<testcases repeat="1">
<testvar varname="SEARCH_TERM">Wolksvagen</testvar>
<case
id="1"
description1="Find information about ${SEARCH_TERM}"
method="get"
verifyresponsecode="200"
url="http://www.google.se/m?dc=gorganic&source=mobileproducts&q=${SEARCH_TERM}"
@chelmertz
chelmertz / Makefile
Created October 8, 2011 22:20
Makefile for c studies
compile = gcc -Wall -c
ignored = *.zip *.pdf *.out *.swp .DS_Store *.o
init:
touch notes.md
for ignored in $(ignored) ; do \
echo $$ignored >> .gitignore ; \
done
default: clean
set @post_id = 587;
select t.term_id, t.name, t.slug
from terms as t
inner join term_taxonomy as tt
on tt.term_id = t.term_id
and taxonomy = 'post_tag'
where tt.term_id in (
select term_taxonomy_id from term_relationships where object_id = @post_id
)
@chelmertz
chelmertz / export.php
Created August 30, 2011 19:11
wordpress to jekyll export
<?php
// The following is modified from https://raw.github.com/tylerhall/clickontyler.com/master/_scripts/import.php by Tyler Hall
// This is the script I used to export my old blog out of WordPress and into a
// Jekyll friendly format. The first half exports posts, the second does pages.
// It's fairly specific to my needs, but maybe it'll be a good starting point
// for you. /RTH 2011-08-28
// https://twitter.com/#!/marcoarment/status/59089853433921537
// imho, a shorter method of escaping should co-exist with the short open tags, since most "echoed" stuff ends up being served as html
<?: "<script>" ?>
//should become
&lt;script&gt;
@chelmertz
chelmertz / iterm2.md
Created July 8, 2011 19:11
iterm2 cheatsheet

#split window horizontally ⌘ + d

@chelmertz
chelmertz / colored_git_branch_prompt.sh
Created April 29, 2011 18:17
show current branch in bash prompt
#from http://www.jonmaddox.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
@chelmertz
chelmertz / common_commands.sh
Created April 19, 2011 08:51
git & bash - common commands
grep -l match_against in_files # -l only lists filenames
ls -1 # filenames STDIN ready
ls -x # space separated filenames
git show HEAD~1:index.html # what did I just commit?
git checkout HEAD~1 index.html # regret one file of a commit, not a complete rollback
@chelmertz
chelmertz / tail.sh
Created March 15, 2011 09:54
tail php
alias tail_php="clear;date;tail -f /var/log/apache2/error.log -n 0"