Skip to content

Instantly share code, notes, and snippets.

View gossi's full-sized avatar

Thomas Gossmann gossi

View GitHub Profile
## Sample Propel configuration file ##
# NOTE: Some proposed structure
## General settings ##
general:
# The name of your project.
# This affects names of generated files, etc.
project:
version: 2.0.0-dev
@gossi
gossi / gist:728625
Created December 5, 2010 00:16
Spacetree Label fitInNode
$jit.ST.Label.Native = new Class({
Implements: Graph.Label.Native,
renderLabel: function(canvas, node, controller) {
var ctx = canvas.getCtx(),
coord = node.pos.getc(true),
height = 0, maxHeight, lineHeight, restText, testLastLine, textSplit,
width = node.getData("width"), modifyLastLine = false, lines, i, len, y;
if (!canvas.viz.config.Node.autoWidth && ctx.measureText(node.name).width > width) {
@gossi
gossi / gist:899912
Created April 2, 2011 21:22
Ideas for defining properties on Javascript "classes"
// Method 1:
MyClass = Class({
extends : "AnotherClass",
mixins : ["Event"],
construct : function () {
console.log("constructor message");
},
@gossi
gossi / gist:1044628
Created June 24, 2011 11:46
Storing php listeners in a database
This is about storing php listeners in a database.
Listeners are typically stored on objects waiting for an event using the Observer design pattern. Looks like this:
$myListener = new MyListener();
$myRecord->addlistener($myListener);
// or
$myRecord->addListener('event.created', $myListener);
From my point of view, the listener parameter of the addListener method could handle 4 different types of listeners:
@gossi
gossi / gist:1307151
Created October 23, 2011 09:16
Deadlock Problem in JS.Class
<!doctype html>
<html>
<head>
<title>JS.Class loader</title>
<script type="text/javascript">JSCLASS_PATH = 'lib/jsclass-3.0.4/min'</script>
<script type="text/javascript" src="lib/jsclass-3.0.4/min/loader-browser.js"></script>
</head>
<body>
<script type="text/javascript">
JS.require('JS.Class', function() {
@gossi
gossi / gist:1934685
Created February 28, 2012 19:50
Bresenham Algorithmus
function setPixel(x, y) {
console.log("Pixel auf %s/%s", x, y);
}
function bresenham(start, end) {
var dx = end.x - start.y,
dy = end.y - start.y,
x = start.x,
y = start.y,
err = dx / 2;
@gossi
gossi / dabblet.css
Created April 5, 2012 19:03
CSS Animations (auto values)
/**
* CSS Animations (auto values)
*/
#anim {
border: 1px solid;
padding: 3px;
background-color: green;
color: white;
width: auto;
transition: width 1s;
@gossi
gossi / gist:5928634
Last active December 19, 2015 08:49
Keeko Stub App
<?php
class Stub extends AbstractApp {
public function run(Request $req) {
$router = new ModuleActionRouter('stub', $this->appRouter->getPrefix());
$route = $router->match($this->appRouter->getDestination());
$main = '';
try {
$moduleManager = new ModuleManager($this->classLoader);
@gossi
gossi / dabblet.css
Created January 12, 2014 19:24
css-variables
/**
* css-variables
*/
:root {
var-bg: red;
}
div {
margin: 20px;
@gossi
gossi / grep-repos.sh
Last active June 9, 2017 16:53
Shell script to pull git repositories in vendor/repo format
#!/bin/sh
###########################
## Shell script to clone a list of github repositories and run `mvn clean install` on each one of them
##
## Authors: Robert Gründler, Thomas Gossmann
## Usage: put a file called `repos.txt` in the folder of the script containing the repository URLs, line by line:
##
## https://github.com/pulse00/Composer-Eclipse-Plugin.git
## git@github.com:pulse00/Symfony-2-Eclipse-Plugin.git