Skip to content

Instantly share code, notes, and snippets.

// 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");
@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 <[email protected]>
## Modified 2014 Simon Oberhammer <[email protected]>
@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'],
#!/bin/sh
#
# Plugin to monitor HTTP response ( httping )
# MIT Licence
# Sept 9, 2012 Masahito Zembutsu <[email protected]>
#%# family=auto
#%# capabilities=autoconf
. $MUNIN_LIBDIR/plugins/plugin.sh
#!/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
@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;
@oberhamsi
oberhamsi / index.js
Created July 21, 2013 11:18
requirebin sketch
/**
* @fileoverview
* Draw lines, polygons, circles, etc on the screen.
* Render text in a certain font to the screen.
*/
var gamejs = require('gamejs');
var draw = require('gamejs/draw');
var font = require('gamejs/font');
function main() {
@oberhamsi
oberhamsi / index.js
Created July 21, 2013 11:18
requirebin sketch
/**
* @fileoverview
* Draw lines, polygons, circles, etc on the screen.
* Render text in a certain font to the screen.
*/
var gamejs = require('gamejs');
var draw = require('gamejs/draw');
var font = require('gamejs/font');
function main() {
@oberhamsi
oberhamsi / ringojs-0.9.1.iss
Last active December 19, 2015 23:59
ringojs inno setup script
[Setup]
AppName=RingoJs
AppVersion=0.9.1
DefaultDirName={pf}\ringojs-0.9
DefaultGroupName=ORF ON
Compression=lzma2
SolidCompression=yes
[Files]
Source: "ringojs-0.9\*"; DestDir: "{app}"; Flags: createallsubdirs recursesubdirs
@oberhamsi
oberhamsi / uid.js
Created July 11, 2013 16:56
imagesrv adition DOT com/js/acb/uid.html
var key ='ad_uid';
var IdWs = new function () {
function g(c, a) {
var b;
void 0 !== a && document.getElementById(a) ? b = document.getElementById(a) : (b = document.createElement(c), b.id = a);
b.style.visibility = "hidden";
b.style.position = "absolute";
document.body.appendChild(b);
return b