Skip to content

Instantly share code, notes, and snippets.

@esfand
esfand / gist:2717459
Created May 17, 2012 08:43 — forked from jbrisbin/gist:1444077
Reactor-based framework versus Node.js streaming

I've been hacking away recently at a JVM framework for doing asynchronous, non-blocking applications using a variation of the venerable Reactor pattern. The core of the framework is currently in Java. I started with Scala then went with Java and am now considering Scala again for the core. What can I say: I'm a grass-is-greener waffler! :) But it understands how to invoke Groovy Closures, Scala anonymous functions, and Clojure functions, so you can use the framework directly without needing wrappers.

I've been continually micro-benchmarking this framework because I feel that the JVM is a better foundation on which to build highly-concurrent, highly-scalable, C100K applications than V8 or Ruby. The problem has been, so far, no good tools exist for JVM developers to leverage the excellent performance and manageability of the JVM. This yet-to-be-publicly-released framework is an effort to give Java, Groovy, Scala, [X JVM language] developers access to an easy-to-use programming model that removes the necessity

@esfand
esfand / registerCustomer.coffee
Created June 20, 2012 15:27 — forked from moredip/registerCustomer.coffee
Alternative functional approach to dealing with the async pyramid. This is a response to http://wekeroad.com/2012/04/05/cleaning-up-deep-callback-nesting-with-nodes-eventemitter/
validate = (customer, next)->
console.log 'validating...'
#VALIDATE HERE
next()
insert = (customer, next)->
console.log 'inserting...'
# insert into DB (asynchronously of course), and then call...
next()
import org.glassfish.jersey.media.json.JsonJacksonModule;
import org.glassfish.jersey.server.Application;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
import org.glassfish.jersey.test.TestProperties;
import org.glassfish.jersey.test.spi.TestContainer;
import org.junit.Test;
import javax.ws.rs.core.MediaType;
@esfand
esfand / .excludes
Created March 9, 2013 08:07 — forked from dwayne/.excludes
# Exclude files that don't need to be on the server
# Used by rsync when deploying code to the server
.excludes
.git
.gitignore
log/
tmp/
package main
import (
"log"
"net/http"
"os"
"fmt"
)
// Environment variables
package com.ontometrics.util;
import java.util.Calendar;
import java.util.Date;
/**
* Provides a fluent builder interface for constructing Dates and DateTimes.
*/
public class DateBuilder {
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit
@esfand
esfand / app.js
Created June 9, 2013 03:25 — forked from fideloper/app.js
Javascript Module Sample
var Fancy = require('FancyModule');
var mod = new Fancy();
mod.on('success', function(data) {
console.log(data); // { this_is_fancy:'indubitably' }
});
<?php
class HookController extends Zend_Controller_Action {
public function preDispatch() {
$this->_helper->viewRenderer->setNoRender(true);
if (!$this->_request->isPost()) {
throw new Exception('POST required');
}
@esfand
esfand / loggly.conf
Created August 14, 2013 06:02 — forked from lox/loggly.conf
# loggly
source s_all {
file ("/proc/kmsg" log_prefix("kernel: "));
unix-stream ("/dev/log");
internal();
file("/mnt/log/apache2/error.log" follow_freq(1) flags(no-parse));
};
destination d_loggly {
tcp("logs.loggly.com" port(14791));