Skip to content

Instantly share code, notes, and snippets.

@oberhamsi
oberhamsi / index.js
Created March 12, 2014 11:45
requirebin sketch
var gamejs = require('gamejs');
var SCREEN_WIDTH = 400;
var SCREEN_HEIGHT = 400;
// ball is a colored circle.
// ball can circle through color list.
// ball constantly pulsates in size.
function Ball(center) {
this.center = center;
#!/bin/bash
# Reads the player position via telnet and writes it to tracks.csv. Can be
# sourced or executed.
# The tracks.csv file can be display in the map viewer https://github.com/nicolas-f/7DTD-leaflet/
. /usr/local/lib/7dtd/common.sh
# @@ this should be a per instance config, not per server
SDTD_TRACKS_PATH=/path/to/tracks.csv
#!/bin/sh
#
# Plugin to monitor HTTP response ( httping )
# MIT Licence
# Sept 9, 2012 Masahito Zembutsu <zem@pocketstudio.jp>
#%# family=auto
#%# capabilities=autoconf
. $MUNIN_LIBDIR/plugins/plugin.sh
@oberhamsi
oberhamsi / cors-auth-server.js
Created July 4, 2014 12:11
cors basicauth tester
var {Application} = require("stick");
var {Server} = require("ringo/httpserver");
var response = require("ringo/jsgi/response");
var app = exports.app = new Application();
app.configure("cors", "route");
app.cors({
allowOrigin: ['http://orf.at', 'http://www.orf.at', 'http://simon.orf.at'],
@oberhamsi
oberhamsi / index.cgi
Last active August 29, 2015 14:04
self-hosted pastebin
#!/bin/bash
## This is vpaste.net minus most features.
##
## * Uploaded text is stored as plain-text files in ${DBFOLDER}
## * Automatic syntax highlight detection powered by highlight.js
##
## Copyright 2009-2013 Andy Spencer <andy753421@gmail.com>
## Modified 2014 Simon Oberhammer <simon@nekapuzer.at>
// Simple eventsource benchmark server
// sends the template file html/eventsource.html every BROADCAST_TIMEOUT seconds
// to all connected clients. The clients are forcefully disconnected by the server
// after between MIN_COUNTER and MAX_COUNTER seconds (random).
var BROADCAST_TIMEOUT = 10;
var MIN_COUNTER = 5;
var MAX_COUNTER = 10;
var response = require("ringo/jsgi/response");

User

FIXME

Attributes

Name Type Description Example
created_at date-time when user was created "2012-01-01T12:00:00Z"
id uuid unique identifier of user "01234567-89ab-cdef-0123-456789abcdef"
@oberhamsi
oberhamsi / background.js
Created June 3, 2015 07:00
video downloader
// Video Infos holen
var jsonString = $(".player_viewport").find("DIV:nth-child(4)").attr("data-jsb");
var videoObj = $.parseJSON(jsonString);
if (videoObj.playlist.videos.length == 1) {
var sources = videoObj.selected_video.sources;
// Download-Menü erstellen
createDownloadMenu(".mod_player > .service_footer", "Sendung herunterladen");
@oberhamsi
oberhamsi / reinhardt-i18n.js
Last active August 29, 2015 14:24
reinhardt i18n strawman
var {Application} = require('stick');
var {Reinhardt} = require('reinhardt');
var ResBundle = require("ilib/lib/ResBundle");
// Resources is the interface that reinhardt requires
var Resources = function(locale) {
this.rb = new ResBundle({
locale: locale,
type: "html",
loadParams: {
diff --git a/modules/helma/skin.js b/modules/helma/skin.js
index e35627b..b6e3928 100644
--- a/modules/helma/skin.js
+++ b/modules/helma/skin.js
@@ -38,7 +38,7 @@ function render(skinOrResource, context, scope) {
} else {
throw Error("Unknown skin object: " + skinOrResource);
}
- return skin.render(context);
+ return skin.render(context, scope);