Skip to content

Instantly share code, notes, and snippets.

View botic's full-sized avatar
👔
working for @orfon and @diehauswirtschaft

Philipp Naderer-Puiu botic

👔
working for @orfon and @diehauswirtschaft
View GitHub Profile
@botic
botic / abgeordnete.txt
Created June 15, 2012 19:50
Parlament
http://www.parlament.gv.at/WWER/PAD_04476/index.shtml
http://www.parlament.gv.at/WWER/PAD_03604/index.shtml
http://www.parlament.gv.at/WWER/PAD_02834/index.shtml
http://www.parlament.gv.at/WWER/PAD_03612/index.shtml
http://www.parlament.gv.at/WWER/PAD_02819/index.shtml
http://www.parlament.gv.at/WWER/PAD_35467/index.shtml
http://www.parlament.gv.at/WWER/PAD_51507/index.shtml
http://www.parlament.gv.at/WWER/PAD_00039/index.shtml
http://www.parlament.gv.at/WWER/PAD_00060/index.shtml
http://www.parlament.gv.at/WWER/PAD_14835/index.shtml
@botic
botic / workflow2csv.js
Created July 15, 2012 07:13
Scripts to convert Taverna output files into a single CSV
/*
* This script reads all files inside a given directory. The filenames are in the following format:
* 1 ... n --> sub workflow n returned a value
* n.error --> sub workflow n threw an error and was not successful
*
*/
var io = require("io");
var fs = require("fs");
var term = require("ringo/term");
@botic
botic / datestest-output.txt
Created July 18, 2012 15:29
RingoJS tests
PS E:\ringojs\ringojs-0.8\test\ringo\utils> ringo .\dates_test.js
================================================================================
+ Running testIsLeapYear_DaysInFebruary_DaysInYear_DaysInMonth ... PASSED (54 ms)
+ Running testAdd ... PASSED (7 ms)
+ Running testBefore_After_Compare ... PASSED (0 ms)
+ Running testFirstDayOfWeek ... PASSED (2 ms)
+ Running testQuarterInYear ... PASSED (1 ms)
+ Running testQuarterInFiscalYear ... PASSED (4 ms)
+ Running testDiff ... PASSED (6 ms)
+ Running testOverlapping ... PASSED (0 ms)
@botic
botic / simple-test.js
Created July 18, 2012 17:09
RingoJS testing
var assert = require("assert");
var log = require("ringo/logging").getLogger(module.id);
var myLittleTestVar = false;
exports.setUp = function() {
log.info("[SET_UP] My little test var: " + myLittleTestVar);
myLittleTestVar = true;
log.info("[SET_UP] My little test var: " + myLittleTestVar);
};
@botic
botic / github-pull.js
Created August 27, 2012 12:59
Github pull request server
include("ringo/subprocess");
var log = require("ringo/logging").getLogger(module.id);
exports.app = function(req) {
log.info("Incoming request.");
if (req.method !== "POST") {
log.info("Not a valid POST request.");
@botic
botic / anotherModule.js
Created September 18, 2012 07:57
RingoJS setTimeout() setInterval() threads / workers
include("ringo/scheduler");
exports.doSchedule = function() {
setInterval(function () {
var nowRunning = java.lang.Thread.currentThread();
console.log("doSchedule :: setInterval(): " + nowRunning.getName());
}, 200);
for (var i = 0; i < 10; i++) {
setTimeout(function() {
@botic
botic / app.js
Last active December 11, 2015 15:19
Chainable JSGI response helper.
var {JsgiResponse} = require("./jsgi-response");
var {Application} = require("stick");
var app = exports.app = Application();
app.configure("route");
app.get("/response", function(req) {
return (new JsgiResponse()).text("Hallo Welt!").setCharset("ISO-8859-15").addHeaders({"x-foo": "baz"});
});
@botic
botic / cors-middleware.js
Last active December 11, 2015 17:19
Enable CORS in Stick applications. For details see: https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
var config = require("./config/config");
exports.middleware = function(next, app) {
return function accessControl(request) {
var response;
if (request.method === "OPTIONS") {
// Handle possible preflight requests
response = {
status: 204, // NO CONTENT
@botic
botic / gist:5221361
Created March 22, 2013 13:42
Array Index
var arrIndex = 0;
if (change < 0.25) {
arrIndex = 1;
} else if (change < 0.50) {
arrIndex = 2;
} else if (change < 0.75) {
arrIndex = 3;
} else if (change < 1) {
arrIndex = 4;
} else if (change < 1.25) {
@botic
botic / preview.json
Created April 9, 2013 21:35
Ausschnitt aus der JSON-Datei mit allen Daten über ParlamentarierInnen von parlament.gv.at
{
"03612": {
"name": "Ablinger Sonja",
"wahlpartei": "SPÖ",
"wahlkreis": "4",
"bundesland": "O",
"geburtsdatum": "12.05.1966",
"beruf": "Lehrerin",
"emails": [
"[email protected]"