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 / select-3rd.js
Created November 7, 2010 15:24
FMI-UE1-EX9
include('ringo/term');
var select3rd = function(n, L) {
var pos = 0, counter = 2, length = L.length;
while (counter >= -1 && pos < length) {
if (L[pos] > n) {
counter--;
}
pos++;
}
<!-- Zweiter Versuch by @yatil --->
<!-- Nun auch mit Sprachauszeichnung. --->
<article>
<hgroup>
<h2>Weitersagen!</h2>
<h1>Die führende <span lang="en">Social Media</span> Agentur Europas sucht:</h1>
</hgroup>
<ul>
<li><span lang="en">Online Designer</span> (<abbr title="männlich">m</abbr>/<abbr title="weiblich">w</abbr>)</li>
<li><span lang="en">Online</span> Konzeptionierer (<abbr title="männlich">m</abbr>/<abbr title="weiblich">w</abbr>)</li>
OntModel om = ModelFactory.createOntologyModel(OntModelSpec.RDFS_MEM, model);
OntClass clazz = om.getOntClass("http://www.semanticweb.org/ontologies/concerts.owl#Admission");
om.createIndividual(clazz.createIndividual(subjectString));
include("ringo/term");
exports.setup = function(exports, path, repo) {
write("Setup");
};
exports.testGetResource = function() {
write("Hello");
};
//
// Jala Project [http://opensvn.csie.org/traccgi/jala]
//
// Copyright 2004 ORF Online und Teletext GmbH
//
// Licensed under the Apache License, Version 2.0 (the ``License'');
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
@botic
botic / wc-regex.html
Created May 10, 2011 13:31
JS Regex Performance Test
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Reading Time Performance Test</title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
<script id="resultTemplate" type="text/x-jquery-tmpl">
<div class="result">
@botic
botic / writeToZip.js
Created July 5, 2011 19:21
Write into a Zip archive with RingoJS.
var fs = require("fs");
var writeToZip = function(files, dest, filePrefix) {
var fos = new java.io.FileOutputStream(dest);
var zos = new java.util.zip.ZipOutputStream(fos);
files.forEach(function(file, index) {
var ze = new java.util.zip.ZipEntry((filePrefix || "") + fs.base(file));
var data = fs.read(file, "b");
@botic
botic / a11y-alttext-orfat.html
Created July 12, 2011 10:52
Debugging ORF.at Alt-Texts
<!DOCTYPE html>
<html>
<head>
<title>Debugging ORF.at Alt-Texts</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
var currentPrefix = "http://orf.at";
@botic
botic / fullround.js
Created August 18, 2011 11:01
Code Snippets
var fullRound = function(from, to) {
var startVal = Math.ceil(from);
var dir = startVal < 0 ? -1 : +1;
while (startVal % to !== 0) {
startVal += dir;
}
return startVal;
}
@botic
botic / 01_upload.html
Created September 5, 2011 21:59
Multiple File Upload with RingoJS
<h1>Upload photos</h1>
<form action="/upload/" method="POST" enctype="multipart/form-data">
<input type="file" name="photos[]" multiple="multiple" />
<hr style="clear: both; border: 0;">
<input type="submit" value="Upload photos" />
</form>