Skip to content

Instantly share code, notes, and snippets.

View white-gecko's full-sized avatar

Natanael Arndt white-gecko

View GitHub Profile
@white-gecko
white-gecko / README
Created November 5, 2012 20:18
The init script to start php-fastcgi to use it with nginx
To use nginx with fastcgi you need following packages:
apt-get install nginx php5-cli php5-cgi spawn-fcgi psmisc
Create a symlink link /etc/init.d/php-fastcgi pointing to ./etc_init.d_php-fastcgi
and a link /usr/bin/php-fastcgi pointing to ./usr_bin_php-fastcgi
Note: Both files need to be executable (chmod +x <file>)
To enable the init script run
sudo update-rc.d php-fastcgi defaults
@white-gecko
white-gecko / kmp_match.php
Created October 20, 2012 22:58
Knuth-Morris-Pratt-Algorithm
<?php
/**
* This is an implementation of the Knuth-Morris-Pratt-Algorithm as in
* Thomas H. Cormen et. al.: "Algorithmen - Eine Einführung"
* (German version by Paul Molitor) 3. Auflage, page 1017
*
* My changes:
* - Indexes starting with 0
* - overlapping matches are recognized
*/
@white-gecko
white-gecko / ink_create_images
Created October 18, 2012 21:57 — forked from DDRBoxman/ink_create_images
Script to create / scale Android resources from vectors
#!/bin/bash
#Requires Inkscape to be installed.
#This script scales and creates images at the correct dpi level for Android.
#It gets placed in a folder called res/drawable/_source_images/ in your
#Android project along with all your svg files.
#When creating svg files set the image size to the size that you want your hdpi images to be.
#To use simply run the create_images script from its folder and it will generate images for all the svg files.
@white-gecko
white-gecko / comment-example.ttl
Created September 19, 2012 13:05
An example model for comment Activities and replies
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix sioc: <http://rdfs.org/sioc/ns#>.
@prefix aair: <http://xmlns.notu.be/aair#> .
@prefix atom: <http://www.w3.org/2005/Atom/> .
@white-gecko
white-gecko / ontowiki
Last active May 26, 2016 21:42
NGINX configuration for OntoWiki
server {
listen [::]:80 default_server ipv6only=off;
root /var/www/localhost/;
error_log /tmp/localhost-error.log;
# optionally also index.html index.htm
index index.php;