Skip to content

Instantly share code, notes, and snippets.

View thomasfr's full-sized avatar

Thomas Fritz thomasfr

View GitHub Profile
@thomasfr
thomasfr / PKGBUILD
Created June 19, 2013 11:33
Arch AUR PKGBUILD file for nginx with google pagespeed
# $Id$
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: Miroslaw Szot <mss@czlug.icis.pcz.pl>
# nginx-pagespeed maintainer: Ludovic Fauvet <etix@l0cal.com>
_cfgdir=/etc/nginx
_tmpdir=/var/lib/nginx
pkgname=nginx-pagespeed
@thomasfr
thomasfr / conditions.js
Last active December 20, 2015 05:29
Coding Guidelines / Coding Styles
// Wrong:
if (condition) alert(foo);
// Correct:
if (condition) {
alert(foo);
}
//-------------------------------------------------
@thomasfr
thomasfr / Spaces.js
Last active December 20, 2015 06:39
WebStorm Code Style Rules
function foo(x, y, z) {
bar(1, b);
var i = 0;
var x = {0: "zero", 1: "one"};
var foo = function () {
}
if (!i > 10) {
for (var j = 0; j < 10; j++) {
switch (j) {
case 0:
@thomasfr
thomasfr / .gitignore
Created July 26, 2013 11:15
sample .gitignore for node.js modules
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var timers = {};
var createGeocodeChangeWhateverFunction = function(timername, $scope) {
var timer = timers[timername];
return function($event) {
if (timer != null) {
clearTimeout(timer);
}
timers[timername] = timer = setTimeout(function() {
timer = null;
getResponseObject = (context) ->
# Later we could extend this to decide which ErrorResponse Object it should use
# based on the given error instance
if context instanceOf Error
object = new ErrorResponse context
else
object = new SuccessResponse context
send = (request, response, context) ->
object = getResponseObject context
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
# - Access-Control-Max-Age=20days, to minimize repetitive OPTIONS requests
@thomasfr
thomasfr / app.service
Created September 9, 2013 14:33
Systemd Services
[Unit]
Description=Description for this application
Requires=network.target
After=network.target
[Service]
WorkingDirectory=/srv/app
ExecStart=/usr/bin/npm start
Restart=always
StandardOuput=syslog

Vienna

Setup

CREATE	(drinks{name:'C1'})-[:CAPTION]->(capGetraenke{caption:"Getränke",lang:"DE"}),
	(drinks)-[:CAPTION]->({caption:"Beverage",lang:"EN"}),
	(drinks)<-[:IS_A]-(spirits{name:"C2"}),
	(spirits)-[:CAPTION]-({caption:"Alkoholische Getränke",lang:"DE"}),