Skip to content

Instantly share code, notes, and snippets.

View meddulla's full-sized avatar

Sofia meddulla

  • Cloudflare
  • Portugal
View GitHub Profile
@meddulla
meddulla / ModelTestCase.php
Created February 3, 2012 12:15 — forked from wowo/ModelTestCase.php
Model Test Case, which loads fixtures and builds database before each test
<?php
require_once(__DIR__ . "/../../../../app/AppKernel.php");
class ModelTestCase extends \PHPUnit_Framework_TestCase
{
protected $_application;
public function setUp()
{
@meddulla
meddulla / gist:3033257
Created July 2, 2012 13:30 — forked from ThomasBurleson/gist:1910025
Using $.post() with Promises
// an IIFE that illustrates different implementations
// of $.post() with Promises
//
// Check out jsFiddle `jQuery and Promises with UI animation`
// - demonstrates $.Deferrred() and custom $.when()
// - @ http://jsfiddle.net/ThomasBurleson/RTLr6/179/
//
var onSubmitFeedback = (function () {
var target = $("#container").append("<div class='spinner'>");
@meddulla
meddulla / gist:3054524
Created July 5, 2012 15:58
node.js exception handler
process.on
(
'uncaughtException',
function (err)
{
var log = err.stack;
// print note to console
console.log("SERVER CRASHED!");
@meddulla
meddulla / gist:3698085
Created September 11, 2012 12:32 — forked from ismasan/gist:464257
Event-emitter module for Javascript objects
/* Abstract event binding
Example:
var MyEventEmitter = function(){};
MyEventEmitter.prototype = new AbstractEventsDispatcher;
var emitter = new MyEventEmitter();
// Bind to single event
emitter.bind('foo_event', function(data){ alert(data)} );
@meddulla
meddulla / Reduce, Kaffeine, NodeJS and Redis
Created September 23, 2012 13:00 — forked from jedisct1/Reduce, Kaffeine, NodeJS and Redis
Tiny recommendation engine using Map/Reduce, Kaffeine, NodeJS and Redis
sys = require "sys";
http = require "http";
url = require "url";
connect = require "connect";
redis = require "redis";
hashRing = require "hash_ring";
Sharding = {
servers = { "127.0.0.1 10000 6378": 1 };
ring = new hashRing.HashRing servers;
@meddulla
meddulla / pgessays.py
Created November 18, 2012 23:22 — forked from olasitarska/pgessays.py
Builds epub book out of Paul Graham's essays.
# -*- coding: utf-8 -*-
"""
Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html
Author: Ola Sitarska <ola@sitarska.com>
This script requires python-epub-library: http://code.google.com/p/python-epub-builder/
"""
import re, ez_epub, urllib2, genshi
@meddulla
meddulla / injector.js
Created December 5, 2012 15:25 — forked from jankuca/injector.js
Injector.js
/**
* @constructor
*/
function Injector() {
/**
* @type {!Object.<string, function(Injector=): !Object>}
*/
this.factories = {};
@meddulla
meddulla / svm.py
Created January 26, 2013 22:07 — forked from mblondel/svm.py
# Mathieu Blondel, September 2010
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)
0MQ
.NET
ActionScript
ActiveMQ
Ada
Agile
Android
angular
Apache
api
To benchmark:
go test -bench=".*" > machine_description.txt