This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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/> . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Initscript to switch LED1 on Olinuxino A13 on and off | |
# | |
### BEGIN INIT INFO | |
# Provides: statusled | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_POST['comment'])) { | |
$to = 'http://example.com/resource#b'; | |
$comment = $_POST['comment']; | |
$pingbackService = 'http://example.com/pingservice'; | |
if (isset($_POST['from']) && !empty($_POST['from'])) { | |
$source = $_POST['from']; | |
} else { | |
$source = 'http://example.com/from-resource#a'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file belongs into /etc/nginx/sites-available and a link to it in /etc/nginx/sites-enabled | |
# if it doesn't work maybe remove the default configuration from /etc/nginx/sites-enabled | |
# | |
# make sure to adjust the root path "root /path/to/xodx/;" below | |
server { | |
# Make site accessible from http://localhost/ | |
#server_name localhost; | |
listen [::]:80 default_server; # listen for ipv6 and ipv4 | |
#listen 80 default_server; # if the ipv6 line doesn't work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% This package provides support for prefixes in qnames | |
% | |
% Defined commands: | |
% \setprefix{foaf}{http://xmlns.com/foaf/0.1/} | |
% Define a prefix namespace | |
% \getprefix{foaf} | |
% Get a defined prefix namespace | |
% \prefix{foaf} | |
% Just output the prefix linked to the namespace | |
% \qname{foaf:Person} has to contain a colon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.Map.Entry; | |
public class AcceptHeader { | |
private HashMap<String, Float> datatypes; | |
public AcceptHeader() { | |
datatypes = new HashMap<String, Float>(); | |
} |
OlderNewer