Skip to content

Instantly share code, notes, and snippets.

<- "PUT /api/settings/ HTTP/1.1\r\nContent-Type: application/xml\r\nX-Billomatapikey: fb72f8e523cf97865005b18c569f3a24\r\nAccept: */*\r\nUser-Agent: Ruby\r\nConnection: close\r\nHost: myapitest.billomat.net\r\nContent-Length: 2443\r\n\r\n"
<- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<settings>\n <article-number-length type=\"integer\">0</article-number-length>\n <article-number-pre nil=\"true\"></article-number-pre>\n <client-number-length type=\"integer\">2</client-number-length>\n <client-number-pre nil=\"true\"></client-number-pre>\n <confirmation-email-body nil=\"true\"></confirmation-email-body>\n <confirmation-email-subject nil=\"true\"></confirmation-email-subject>\n <confirmation-intro nil=\"true\"></confirmation-intro>\n <confirmation-note nil=\"true\"></confirmation-note>\n <confirmation-number-length type=\"integer\">0</confirmation-number-length>\n <confirmation-number-pre nil=\"true\"></confirmation-number-pre>\n <credit-note-email-body nil=\"true\"></credit-note-email-body>\n <cr
@x3ro
x3ro / gist:2909918
Created June 11, 2012 12:43
Running Timadorus Bookkeeper in Eclipse

The following steps worked for me in order to run the AttackProcessTest from inside Eclipse:

  1. Check out the entire project from the SVN url svn co svn+ssh://<haw username>@svn.informatik.haw-hamburg.de/srv/svn/timadorus
  2. cd to Bookkeeper/trunk and execute find . -type d -name ".svn" -exec rm -rf {} \; to delete all SVN directories (these interfered in the execution process from inside eclipse, at least for me on OS X)
  3. Import the project in eclipse
  4. Install Ivy from the eclipse update url http://www.apache.org/dist/ant/ivyde/updatesite
  5. Right-click on the build.xml file and choose "Ant Build"
  6. Locate the AttackProcessTest.java file and right-click, and choose Run As > JUnit Test (this will fail).
  7. Now right-click the file again, and choose Run As > Run Configurations.. and selected the "Environment" tab
  8. Now you must add the following environment variables:
@x3ro
x3ro / gist:2999594
Created June 26, 2012 22:05
Assoc.js Benchmark
function createRandomWord(length) {
var consonants = 'bcdfghjklmnpqrstvwxyz',
vowels = 'aeiou',
rand = function(limit) {
return Math.floor(Math.random()*limit);
},
i, word='', length = parseInt(length,10),
consonants = consonants.split(''),
vowels = vowels.split('');
for (i=0;i<length/2;i++) {
@x3ro
x3ro / stateful_popover.js
Created July 16, 2012 11:07
StatefulPopover for Twitter Bootstrap
!function ($) {
"use strict"; // jshint ;_;
/* POPOVER PUBLIC CLASS DEFINITION
* =============================== */
var StatefulPopover = function ( element, options ) {
this.contentWasSet = false
@x3ro
x3ro / gist:3240690
Created August 2, 2012 21:14
Terasology themeable UI brainstorming
{
"id": "main-menu",
"class": "UIWindow",
"children": [
{
"id" : "main-window",
"class" : "UIWindow",
"image" : "engine:bg.png",
},
@x3ro
x3ro / gist:3252874
Last active October 8, 2015 00:58
WIP - Terasology Themeable GUI

This is a work-in-progress documentation for a themeable GUI prototype for Terasology, based on this forum thread and this forum thread.

Introduction

In order to provide a more easily customizable GUI, the current user interface system is to be enhanced by allowing the user interface definition through JSON files, separating the user interface logic from its actual appearance.

The current user interface system is roughly devided into the following packages:

@x3ro
x3ro / install_teamspeak.sh
Last active September 29, 2019 18:44
Teamspeak 3 installation script for Debian based systens (incl. Ubuntu)
#!/bin/bash
#
# A small script that sets up a teamspeak 3 server.
# Tested on debian and ubuntu.
#
# Source: http://coding-journal.com
#
TMP="/tmp/teamspeak/"
INSTALL_PATH="/usr/local/teamspeak3/"
@x3ro
x3ro / gist:3747057
Created September 19, 2012 01:17
Scala 2.10 – Reflection against Named Arguments
import scala.reflect.runtime.universe._
import scala.reflect.runtime._
def newInstance(tpe:Type, args:Map[String, Any]) = {
val clazz = tpe.typeSymbol.asClass
val ctor = tpe.member(nme.CONSTRUCTOR).asMethod
var argList = ctor.params(0).map { a => args(a.name.toString) }
currentMirror.reflectClass(clazz).reflectConstructor(ctor)(argList:_*)
}
# A little modification to Wynn Netherland's (http://wynnnetherland.com/journal/a-stylesheet-author-s-guide-to-terminal-colors)
# "git n" alias which allows one to specify a subdirectory.
[alias]
n = !"f() { git ls-files $1 | xargs notes | awk -F: '{ print $1,$2; print $3,$4; print $5}' | grcat conf.notes | less -r; }; f"
@x3ro
x3ro / gist:3940442
Created October 23, 2012 18:12
Problems with bandits in WarZ

I think that there are currently three different types of bandits:

  1. Those who kill because they wan't other peoples' gear
  2. Those who kill because they don't want to get killed themselves
  3. Those who kill people for the fun of it

I'm totally fine with type 1, it's part of the game and I won't complain about them. I very much despise the third type, because they simply make the game a bad experience for many people, and I think that type 2 is actually, at least in part, a result of the existence of type 3. Let me explain:

Whenever somebody gets killed by someone else, they will get (at least a little) upset, especially when you didn't have anything worth killing for. Given that this happens most of the time (getting killed for nothing), people get paranoid and kill everyone on sight because they are tired of getting killed all the time. The reason bandits can go around killing everyone on sight is because they don't have anything to fear. They remain completely anonymous.