Skip to content

Instantly share code, notes, and snippets.

View JorgenEvens's full-sized avatar

Jorgen Evens JorgenEvens

View GitHub Profile
@JorgenEvens
JorgenEvens / build-sass-jar.sh
Last active December 19, 2015 17:08
Create a jar which allows the usage of sass and compass through jruby (JVM). This allows you to use sass without having to install Ruby on your system.
#!/bin/sh
# Download a copy of the jruby-complete jar [here](http://www.jruby.org/download),
# and pass it as the first parameter to the script.
JRUBY="$1"
JAVA="java"
# Install compass / sass gems.
$JAVA -jar "$JRUBY" -S gem install compass -i ./tmp/gems
$JAVA -jar "$JRUBY" -S gem install --version '~> 0.9' rb-inotify -i ./tmp/gems
@JorgenEvens
JorgenEvens / .bash_aliasses
Created July 25, 2013 19:16
bash aliasses
alias gitrm='git ls-files -d | xargs git rm'
@JorgenEvens
JorgenEvens / clean.sh
Created August 1, 2013 07:37
Helps clean configuration file form comments
#!/bin/sh
FILE=$1
SEPARATOR="#"
if [ ! -z $2 ]; then
FILE=$2
SEPARATOR=$1
fi
cat "$FILE" | grep -v -P "^\s*${SEPARATOR}" | grep -v -P "^\s*$"
@JorgenEvens
JorgenEvens / inject-env.c
Created August 1, 2013 07:39
Sets custom environment variables before the shell starts. Was usefull as a workaround to get TERM=xterm-color inject when using terminator on ubuntu.
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char **argv) {
char* shell = getenv("SHELL");
if( shell == NULL )
shell = "bash";
char* param[2];
@JorgenEvens
JorgenEvens / deploy-test.sh
Last active December 20, 2015 21:58
Test the build using a custom heroku buildpack on your own machine.
#!/bin/sh
if [ -z $1 ]; then
echo "Usage: $0 project-location"
exit 1
fi
if [ ! -d $1 ]; then
echo "Could not find your project"
exit 2
@JorgenEvens
JorgenEvens / xenvnc.sh
Created August 12, 2013 20:20
Connects to a VNC console on a xen host
#!/bin/sh
HOST=$1
PORT=$2
RUN=true
SOCK=`mktemp -t xenvnc.$HOST.$PORT.XXX`
rm $SOCK
ssh $HOST -f -q -S $SOCK -L $PORT:localhost:$PORT sleep 1d
@JorgenEvens
JorgenEvens / make-sitemap.sh
Created August 29, 2013 21:22
Generates a sitemap by crawling all of the available links. example usages: ./make-sitemap http://my-site.com ./make-sitemap http://my-site.com daily
#!/bin/sh
##################################################
# #
# This script generates a sitemap from an #
# existing website by crawling each page #
# accessible to the outside world. #
# #
# Author: Jorgen Evens <jorgen@evens.eu> #
# License: New BSD License #
@JorgenEvens
JorgenEvens / Angular HTML.tmLanguage
Last active December 26, 2015 00:49
Variable highlighting in AngularJS templates for Sublime Text
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>ang.tpl</string>
<string>ang.html</string>
<string>html</string>
<string>htm</string>
@JorgenEvens
JorgenEvens / db2-long
Created December 30, 2013 13:58
Run a query on a table without hitting the transaction log size
#!/bin/sh
TABLE="$1"
shift
db2 connect to dbarch
db2 +c "alter table $TABLE activate not logged initially"
db2 +c "$@"
db2 commit
@JorgenEvens
JorgenEvens / copydb
Created December 30, 2013 13:59
Copy tables from a shared schema to your local schema in db2
#!/bin/sh
ME=`whoami`
SRC="project"
if [ -z "$1" ]; then
TABLES="table1 table2"
else
TABLES=$@
fi
copy() {