Skip to content

Instantly share code, notes, and snippets.

View DracoBlue's full-sized avatar

DracoBlue

View GitHub Profile
@DracoBlue
DracoBlue / craur.out
Created March 26, 2012 07:44
JSON to CSV conversion by using the cli of https://github.com/DracoBlue/Craur
$ curl -s http://github.com/api/v2/json/issues/list/DracoBlue/node-facebook-client/open | craur issues[].number issues[].title issues[].user
14;"cookie expiration check reversed";enki
17;"Add simple storage for mapping between oauth-code and access_tokens";DracoBlue
24;"Large amount of timeouts over time";dominiek
25;"/Picture api fixed";edjoperez
26;"Add method to FacebookClient to parse signed_request";leoasis
Index: agavi/database/AgaviDoctrineDatabase.class.php
===================================================================
--- agavi/database/AgaviDoctrineDatabase.class.php (revision 759)
+++ agavi/database/AgaviDoctrineDatabase.class.php (working copy)
@@ -119,7 +119,7 @@
// set our event listener that, on connect, sets the configured charset and runs init queries
$cel = $this->getParameter('connection_event_listener_class', 'AgaviDoctrineDatabaseEventListener');
- $this->connection->setListener(new $cel($this));
+ $this->connection->addListener(new $cel($this));
@DracoBlue
DracoBlue / AutoScale.js
Created February 12, 2012 19:12
AutoScale to 320x480, part of swarmfight.com, released under the Public Domain
AutoScale = function(dom_element) {
var that = this;
this.dom_element = dom_element;
var style = dom_element.style;
var transform_property = (style.TransitionDuration === '' && 'Transform');
transform_property = transform_property || (style.MozTransitionDuration === '' && 'MozTransform');
transform_property = transform_property || (style.WebkitTransitionDuration === '' && 'WebkitTransform');
@DracoBlue
DracoBlue / AgaviSyslogLoggerAppender.class.php
Created September 26, 2011 11:47
Syslog-Appender for agavi
<?php
/**
* AgaviSyslogLoggerAppender allows you to log right into a specific tag of the syslog.
*
* @package agavi
* @subpackage logging
*
* Licensed under the Public Domain
*
/**
* @module UserService
*
* @extends Logging
*/
extend(true, exports, Logging.prototype);
exports.logging_prefix = 'UserService';
var assert = require('assert');
<?php
/**
* Reconstruct an array, for small task at: http://www.phpgangsta.de/kleine-aufgabe-ein-array-umbauen
* Contribution by DracoBlue
*/
function compress($in)
{
$in_length = count($in);
var one = 'http://blah'
, two = '/asdf/asdf/af'
;
function regexTest () {
var start = new Date();
var i = 0;
while (i<1000000) {
if ( !/^http?:/.test(one) ) true
if ( !/^http?:/.test(two) ) true
// express_sample.js
// Launched with this command:
// $ EXPRESS_ENV="production" node express_sample.js
var app = require('express').createServer();
app.get('/', function(req, res){
res.send('<h1>Welcome To Testapp</h1>');
});
app.listen(8080);
// picard_sample/app.js
require('./config/env')
get('/', function(){
return { text: '<h1>Hello to TestApp!</h1>' }
})
res.writeHead(200, {
"Content-Type": mime_type,
"Cache-Control": "public, max-age=300",
'Content-Length': content.length
});
// a) works in 0.1.94:
var content_length = content.length;
var i = 0;
while (i<content_length) {