View gist:728625
$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) { |
View gist:729240
/** | |
* JIT Advanced Rectangle | |
* | |
* Usage | |
* ===== | |
* | |
* Node: { | |
* overridable: true, | |
* type: "adv-rect", | |
* CanvasStyles: { |
View gist:899912
// Method 1: | |
MyClass = Class({ | |
extends : "AnotherClass", | |
mixins : ["Event"], | |
construct : function () { | |
console.log("constructor message"); | |
}, | |
View gist:1044628
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: |
View gist:1307151
<!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() { |
View gist:1934685
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; |
View dabblet.css
/** | |
* CSS Animations (auto values) | |
*/ | |
#anim { | |
border: 1px solid; | |
padding: 3px; | |
background-color: green; | |
color: white; | |
width: auto; | |
transition: width 1s; |
View grep-repos.sh
#!/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 |
View gist:5928634
<?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); |
View dabblet.css
/** | |
* css-variables | |
*/ | |
:root { | |
var-bg: red; | |
} | |
div { | |
margin: 20px; |
OlderNewer