Skip to content

Instantly share code, notes, and snippets.

View knalli's full-sized avatar
👨‍💻

Jan Philipp knalli

👨‍💻
View GitHub Profile
@knalli
knalli / steal-example.coffee
Created July 4, 2012 19:28
Einfaches Steal-Beispiel (CoffeeScript)
steal('jquery').then -> $(document).find('title').text 'Hello World'
@knalli
knalli / steal-example.js
Created July 4, 2012 19:27
Einfaches StealJS Beispiel
steal('jquery').then(function(){
$(document).find('title').text('Hello World');
});
@knalli
knalli / example1.xml
Created June 11, 2012 20:37
Ant Copy Dont Override
<copy file="${basedir}/target/jslint4java/jslint.xml" tofile="${basedir}/target/jslint.xml" overwrite="false" />
@knalli
knalli / extension.rb
Created May 23, 2012 15:36
SASS Extension for dynamic absolute paths
# This extension makes the SASS function "application_resources_url" available, which will return the absolute path within a spring mvc managed application.
#
# The implementation relays on a central java properties file located at src/main/resources/application.properties. It should contain at least following keys
# webapp.version -- a string, e.g. 1.0.0
# webapp.build -- a string, e.g. 45
# webapp.context -- a string, e.g. app (optional, if empty only / will be used)
#
# Version 1.0 (2012-05-23, Jan Philipp <[email protected]>)
# Under MIT License
#
@knalli
knalli / gist:2580025
Created May 2, 2012 20:12
Locks a script/binary as preparation for sudo usage
# Removes write access for all users (avoids injecting code)
sudo chmod -w /path/to/your/script
# Transfers the script to root (owned by)
sudo chown root /path/to/your/script
@knalli
knalli / gist:2579934
Created May 2, 2012 20:07
Entry of sudoers executing a script with root (superuser) only w/ the local personal account (for Mac OS X)
# USER := your username
USER ALL=NOPASSWD: /path/to/your/script
@knalli
knalli / my-route-script.sh
Created May 1, 2012 13:26
Adding an additional route via a gateay
#!/bin/bash
# Routing the 192.168.1.0/24 net via the gateway at 192.168.0.101
sudo route -n add 192.168.1.0 192.168.0.101 255.255.255.0
@knalli
knalli / airplay-activator.js
Created April 26, 2012 17:53
Activates AirPlay in the browser (refeshes any "video" element)
(function(){
var fn = function(){
$('video').each(function(i, video){
var $video = $(video);
if (!$video.attr('x-webkit-airplay')) {
$video.attr({
'x-webkit-airplay' : 'allow',
'airplay' : 'allow',
'controls' : 'controls'
});
@knalli
knalli / gist:2438284
Created April 21, 2012 16:44
Install Brief-ChatStyle for Skype 5 for Mac
cd ~/Library/Application\ Support/Skype/
if [ ! -d ChatStyles ]; then mkdir ChatStyles; fi
if [ ! -d ChatStyles/sources-by-github ]; then mkdir ChatStyles/sources-by-github; fi
cd ChatStyles/sources-by-github
git clone https://github.com/miekd/Brief.git
cd ~/Library/Application\ Support/Skype/ChatStyles
ln -s sources-by-github/Brief/Brief.SkypeChatStyle
@knalli
knalli / confluence
Created August 7, 2011 12:22
Atlassian Service Scripts
#!/bin/sh -e
# Confluence startup script
#chkconfig: 2345 80 05
#description: Confluence
#original found at: http://confluence.atlassian.com/display/DOC/Start+Confluence+automatically+on+Linux+and+UNIX
# Define some variables
# Name of app ( JIRA, Confluence, etc )
APP=confluence
# Name of the user to run as