Skip to content

Instantly share code, notes, and snippets.

@Cacodaimon
Cacodaimon / Mcrypt.php
Last active December 24, 2015 04:29
Easy to use Mcrypt wrapper class.
<?php
namespace Caco\Password;
/**
* Mcrypt wrapper class.
*
* @author Guido Krömer <mail@cacodaemon.de>
* @package Caco\Password
*/
class Mcrypt
@Cacodaimon
Cacodaimon / index.html
Created July 23, 2013 11:31
Quick and dirty Google Feed API example, fetching the first image of each feed item.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Google Feed API JSONP Example displaying some Images - wwww.cacodaemon.de</title>
<script type="text/javascript">
function processResults (response) {
var entries = response.responseData.feed.entries;
var images = document.getElementById('images');
@Cacodaimon
Cacodaimon / convert.php
Last active December 15, 2015 01:49
Converts the questions from the "OCA Java SE 7 Programmer 1 Study Guide (Exam 1Z0-803)" book CD into a readable JSON format. The dBASE files from the book disc have to be exported to a csv file first.
<?php
/**
* Converts the questions from the "OCA Java SE 7 Programmer 1 Study Guide (Exam 1Z0-803)" book CD into a readable JSON format.
* The dBASE files from the book disc have to be exported to a csv file first.
*
* @autor Guido Krömer <mail@cacodaemon.de>
*/
$fileQuestions = 'Questions.csv';
$fileAnswers = 'Answers.csv';
@Cacodaimon
Cacodaimon / TestJs.js
Last active December 10, 2015 18:38
Quick comparison between TypeScript and JavaScript, with a semantic error (sub method missing in Vector3 class). Used @ cacodaemon.de
function Vector2(x, y) {
this.x = x ? x : 1;
this.y = y ? y : 1;
this.add = function(vector2) {
return new Vector2(this.x + vector2.x, this.y + vector2.y);
};
this.sub = function(vector2) {
return new Vector2(this.x - vector2.x, this.y - vector2.y);
@Cacodaimon
Cacodaimon / GameManager.js
Last active November 13, 2018 23:04
JavaScript Canvas textured raycaster, used @ cacodaemon.de.
/*
* Simple JavaScript game manager.
*
* By Guido Krömer <mail@cacodaemon.de> 2013
*
*/
function GameManager () {
var canvas = null;
var ctx = null;
var delta = 0;
@Cacodaimon
Cacodaimon / split_image.php
Created December 17, 2012 12:35
Creates some kind of combined image from a given set of images. Used @ cacodaemon.de
<?php
/**
* Creates some kind of combined image from a given set of images.
* All images should have the same resolution.
* Used and explained at www.cacodaemon.de
*
* Autor Guido Krömer
* E-Mail: mail<at>cacodaemon.de
*
*/
@Cacodaimon
Cacodaimon / GameManager.js
Last active October 13, 2015 19:57
Simple untextured Raycaster example from cacodaemon.de
/*
* Simple JavaScript game manager.
*
* By Guido Krömer <mail@cacodaemon.de>
*
*/
function GameManager () {
var canvas = null;
var ctx = null;
var delta = 0;
@Cacodaimon
Cacodaimon / GameManager.js
Created December 3, 2012 00:54
Abstract game object class. (Used @ cacodaemon.de)
/*
* Simple JavaScript game manager.
*
* (c) 2012 Guido Krömer <mail@cacodaemon.de>
*
*/
function GameManager () {
var canvas = null;
var ctx = null;
var delta = 0;
@Cacodaimon
Cacodaimon / index.html
Created November 24, 2012 16:58
JSONP Example used @ cacodaemon.de
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSONP example</title>
<script>
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://cacodaemon.de/tutorials/jsonp_example.js';
document.getElementsByTagName('head')[0].appendChild(script);
@Cacodaimon
Cacodaimon / ChatClient.js
Created November 23, 2012 14:43
Used @ cacodaemon.de
module.exports.ChatClient = function () {
if (module.exports.ChatClient.instance) {
return module.exports.ChatClient.instance;
}
module.exports.ChatClient.instance = this;
this.host = null;
this.welcomeTime = 0;
var interval = null;