Skip to content

Instantly share code, notes, and snippets.

Avatar

Roman Simecek raskhadafi

View GitHub Profile
@raskhadafi
raskhadafi / mailcatcher.conf
Last active May 2, 2017
Nginx configuration for mailcatcher
View mailcatcher.conf
upstream mailcatcher {
sticky;
server appserver.domain.ch:3000 max_fails=1 fail_timeout=2s;
}
server {
listen 80;
server_name mailcatcher.domain.ch;
client_max_body_size 4G;
keepalive_timeout 5;
View daemonize.rb
require 'rubygems'
require 'spoon'
Spoon.spawnp 'jruby', *ARGV
@raskhadafi
raskhadafi / gist:640385
Created Oct 22, 2010
Bash command for a timestamp
View gist:640385
date +%Y-%m-%d_%H-%M-%S
@raskhadafi
raskhadafi / gist:640354
Created Oct 22, 2010
Rake bash completion
View gist:640354
#!/usr/bin/env ruby
# Complete rake tasks script for bash
# Save it somewhere and then add
# complete -C path/to/script -o default rake
# to your ~/.bashrc
# Xavier Shay (http://rhnh.net), combining work from
# Francis Hwang ( http://fhwang.net/ ) - http://fhwang.net/rb/rake-complete.rb
# Nicholas Seckar <nseckar@gmail.com> - http://www.webtypes.com/2006/03/31/rake-completion-script-that-handles-namespaces
# Saimon Moore <saimon@webtypes.com>
@raskhadafi
raskhadafi / gist:551077
Created Aug 26, 2010
Extracts a sub folder to own git repo
View gist:551077
# extract sub folder to git root with all the history
git filter-branch --subdirectory-filter folder -- --all
@raskhadafi
raskhadafi / convert a css in a directory to sass
Created Aug 12, 2010
convert css of a directory to sass
View convert a css in a directory to sass
#!/bin/bash
if [ -z "$1" ]; then
wdir="."
else
wdir=$1
fi
for f in $( ls $wdir/*.css ); do
out="${f%.css}.sass"
if [ -e $out ]; then
@raskhadafi
raskhadafi / gist:511355
Created Aug 6, 2010 — forked from terrbear/gist:347837
Convert all html of a dir to haml
View gist:511355
#!/bin/bash
if [ -z "$1" ]; then
wdir="."
else
wdir=$1
fi
for f in $( ls $wdir/*.erb ); do
out="${f%.erb}.haml"
if [ -e $out ]; then
@raskhadafi
raskhadafi / gist:375114
Created Apr 22, 2010
vserver debian set locales
View gist:375114
# set perl locales on debian
apt-get install locales language-env
dpkg-reconfigure locales
# and as root
set-language-env -E
@raskhadafi
raskhadafi / gist:344806
Created Mar 26, 2010
some usefull aliases
View gist:344806
# copy with progress
alias copy='rsync -rv $1 $2 --progress'
# ps of something
alias psgrep='ps -ef | grep'
View gist:311175
# configure my multi-line prompt
# tested on:
# * os x -> .bash_profile
#
PS1='
$PWD
==> '
You can’t perform that action at this time.