Skip to content

Instantly share code, notes, and snippets.

View kogakure's full-sized avatar
🏠
Working from home

Stefan Imhoff kogakure

🏠
Working from home
View GitHub Profile
@kogakure
kogakure / gist:3052615
Created July 5, 2012 09:35
Bash: Disguise Google Chrome as a different browser
/Application/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-agent="Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; de-de) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9" &
@kogakure
kogakure / qunit.css
Created July 4, 2012 15:11
JavaScript: QUnit Template
/**
* QUnit v1.5.0 - A JavaScript Unit Testing Framework
*
* http://docs.jquery.com/QUnit
*
* Copyright (c) 2012 John Resig, Jörn Zaefferer
* Dual licensed under the MIT (MIT-LICENSE.txt)
* or GPL (GPL-LICENSE.txt) licenses.
*/
@kogakure
kogakure / admin.html
Created June 24, 2012 12:45 — forked from kmiyashiro/admin.html
JavaScript: Mocha HTML spec
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../libs/mocha.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div id="mocha"></div>
<script src="../libs/mocha.js" type="text/javascript" charset="utf-8"></script>
@kogakure
kogakure / gist:2899993
Created June 9, 2012 07:35
JavaScript: Mocha – JavaScript testing in the browser (Template)
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<link rel="stylesheet" href="mocha.css" />
<script src="jquery.js"></script>
<script src="mocha.js"></script>
<script>mocha.setup('bdd')</script>
<!-- My test suite -->
<!-- And inside, I leverage 'require()' to load the script to I want to test -->
@kogakure
kogakure / gist:2653828
Created May 10, 2012 15:15 — forked from cameronmcefee/gist:2641743
JSON: Font Configuration File
# Font Squirrel Font-face Generator Configuration File
# Upload this file to the generator to recreate the settings
# you used to create these fonts.
{"mode":"expert","formats":["ttf","woff","eot","svg"],"tt_instructor":"default","options_subset":"advanced","subset_custom":"","subset_custom_range":"f000-f073,f200-f273","filename_suffix":"-webfont","emsquare":"2048","spacing_adjustment":"0","rememberme":"Y"}
@kogakure
kogakure / django_2012.md
Created May 5, 2012 09:41 — forked from trey/django_2012.md
Bash: How to start a Django project in 2012

How to start a Django project in 2012

(and deploy to Heroku)

First, warm up your system.

$ easy_install pip
$ pip install virtualenv
$ pip install django
$ gem install heroku
@kogakure
kogakure / .vimrc
Created March 9, 2012 14:11
Vim: Mehrere Zeilen verschieben
" Mehrere Zeilen verschieben
vmap <C-S-Up> [egv
vmap <C-S-Down> ]egv
@kogakure
kogakure / .vimrc
Created March 9, 2012 14:10
Vim: Vsplits/Splits vergrößern/verkleinern
" Vsplits/Splits vergrößern/verkleinern
map <kPlus> <C-w>+
map <kMinus> <C-w>-
map <kDivide> <C-w><
map <kMultiply> <C-w>>
@kogakure
kogakure / .vimrc
Created March 9, 2012 14:08
Vim: Escape/Unescape HTML
" Escape/Unescape HTML
function! HtmlEscape()
silent s/&/\&amp;/eg
silent s/</\&lt;/eg
silent s/>/\&gt;/eg
endfunction
function! HtmlUnEscape()
silent s/&lt;/</eg
silent s/&gt;/>/eg
@kogakure
kogakure / pre-commit
Created January 19, 2012 09:37
Bash: Check code on patterns on Git commit and stop the commit if any are found
#!/bin/bash
# Author: Nikolaos Dimopoulos
# Based on code by Remigijus Jarmalavičius
# Checks the files to be committed for the presence of print_r(), var_dump() and die()
# The array below can be extended for further checks
checks[1]="\[RES\]"
checks[2]="console\.log"
element_count=${#checks[@]}