Skip to content

Instantly share code, notes, and snippets.

@turbod
turbod / getopts.zsh
Created September 8, 2012 15:46
Processing options and parameters with getopts
#!/bin/zsh
# processing options and parameters with getopts
while getopts :a:b:cd opt
do
case "$opt" in
a) echo "The -a option, value $OPTARG";;
b) echo "The -b option, value $OPTARG";;
c) echo "The -c option";;
d) echo "The -d option";;
@turbod
turbod / a2gen.zsh
Created September 9, 2012 07:23
Setting up Apache virtualhost and project dir.
#!/bin/zsh
# Setting up Apache virtualhost and project dir.
# Is localhost subdomain the project url?
localhostSubdomain=0
# The document root inside the project dir.
root=""
# The workspace directory.
@turbod
turbod / composer.json
Created September 18, 2012 06:27
Add gihub package to composer.json
"repositories": [
{
"type": "package",
"package": {
"version": "master",
"name": "turbod/bootstrap",
"source": {
"url": "https://github.com/turbod/bootstrap.git",
"type": "git",
"reference": "master"
@turbod
turbod / .zshrc
Created September 26, 2012 07:27
oh-my-zsh configuration file
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="afowler"
# Example aliases
@turbod
turbod / grep
Created October 22, 2012 20:27
Search code snippet in a project directory
grep '>getWebsites' app/code -rsn
@turbod
turbod / benchmark.sh
Created October 30, 2012 06:50
test Google with 20 concurrent connections for 30 seconds, and then get a nice report at the end
siege -c20 www.google.co.uk -b -t30s
@turbod
turbod / KozpontiElosztottBeszerzesEdit.coffee
Created November 5, 2012 08:38
ActionColumn item handler function, ExtJS 4.0.7
actionColumn = @getTetelekGrid().down('actioncolumn')
actionColumn.items[0].handler = (gridview, rowIndex, colIndex, actionItem, eopts)->
record = gridview.store.getAt rowIndex
@turbod
turbod / vhostgen.sh
Created November 16, 2012 09:04
Generate apache vhosts in UNIX (os x) system.
#!/bin/bash
VHOST_CONF=/etc/apache2/extra/httpd-vhosts.conf
ROOT_UID=0
NOTROOT=87
WWW_ROOT=/Volumes/Storage/norbi/www/
# owner of the site directory
WEBUSER=$SUDO_USER
@turbod
turbod / gist:4573622
Created January 19, 2013 16:53
Import an existing repository
$ cd /path/to/my/repo
$ git remote add origin ssh://git@bitbucket.org/norbi/polcrendszerek.git
$ git push -u origin --all # to push changes for the first time
@turbod
turbod / gist:4680837
Created January 31, 2013 06:43
Remove svn folders on linux
find . -iname ".svn" -print0 | xargs -0 rm -r