Skip to content

Instantly share code, notes, and snippets.

@knalli
knalli / 030_modify_plist.sh
Last active September 17, 2015 16:35 — forked from flpwgr/030_modify_plist.sh
Cordova Hook for App Transport Security iOS 9
#!/bin/bash
PLIST=platforms/ios/*/*-Info.plist
cat << EOF |
Add :NSAppTransportSecurity dict
Add :NSAppTransportSecurity:NSAllowsArbitraryLoads bool YES
EOF
while read line
do
@knalli
knalli / example1.css
Created July 24, 2011 19:20
CSS3: SASS, Compass, PIE und IE
div.header-chrome {
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #00346e), color-stop(100%, #001c3b));
background-image: -webkit-linear-gradient(#00346e, #001c3b);
background-image: -moz-linear-gradient(#00346e, #001c3b);
background-image: -o-linear-gradient(#00346e, #001c3b);
background-image: -ms-linear-gradient(#00346e, #001c3b);
background-image: linear-gradient(#00346e, #001c3b);
}
@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
@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 / 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 / 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 / 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
'use strict';
let Service = require("HAP-NodeJS").Service;
let Characteristic = require("HAP-NodeJS").Characteristic;
let WebSocketClient = require('websocket').client;
class Utils {
assertUtf8Message(message) {
return new Promise((resolve, reject) => {
if (message.type === 'utf8') {
@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 <jan@philipp-online.de>)
# Under MIT License
#