Skip to content

Instantly share code, notes, and snippets.

@AGoblinKing
AGoblinKing / component.js
Last active August 29, 2015 14:14
Mithril Components using a Module Loader
var m = require("mithril");
module.exports = function Component(ctrl) {
var foo = ctrl.Component.foo = m.prop(5);
ctrl.Component.clicked = function() {
ctrl.Component.foo(++foo);
};
return function ComponentView() {
angular.module('restangularDemoApp', [
'restangular',
'ngCookies'
])
.constant('apiKey', 'YOUR_Mongolab_API_KEY')
.config(function(RestangularProvider, apiKey) {
RestangularProvider.setBaseUrl('https://api.mongolab.com/api/1/databases/YOURDATABASE/collections');
RestangularProvider.setDefaultRequestParams({
apiKey: apiKey
})
@werediver
werediver / singleton.py
Created December 28, 2012 09:51
A thread safe implementation of singleton pattern in Python. Based on tornado.ioloop.IOLoop.instance() approach.
import threading
# Based on tornado.ioloop.IOLoop.instance() approach.
# See https://github.com/facebook/tornado
class SingletonMixin(object):
__singleton_lock = threading.Lock()
__singleton_instance = None
@classmethod
@nkabir
nkabir / deal-event.xml
Created August 15, 2012 18:39
Event Types
<dealEvent id="1">
<refQ>100</refQ> // reference quotable
<reporter>123</reporter> // reporter {Bloomberg, Reuters, Datastream}
<serialDay>42000</serialDay> // include Gregorian attribute?
<millis>0</millis> // utc millis
<level>543.0</level>
<facets> // facets include a set of integer flags that indicate CLOSE, OPEN, WARN
<facet>1</facet> // mixed purpose but may be small enough set to be ok
</facets>
<pMaker>100</pMaker> // price maker id
@nkabir
nkabir / txdb.sql
Created August 15, 2012 16:14
txdb database schema
alter table TX_SYMBOL
drop constraint TX_SYMBOL_QUOTABLE_ID_FK;
alter table TX_SYMBOL
drop constraint TX_SYMBOL_SERIES_ID_FK;
alter table TX_SYMBOL_SERIES
drop constraint TX_SYMBOL_SERIES_AGENT_ID_FK;
@nkabir
nkabir / eclipse-juno.md
Created July 27, 2012 18:41
Eclipse Juno Setup for Python

Eclipse for Python Development

Note that we use separate installations of Eclipse for various languages:

  • Java
  • C/C++
  • Scripting: Javascript, Bash and Python

Download Eclipse Juno JEE.

@nkabir
nkabir / sources.list
Created May 15, 2012 16:34
Files for PrecisePangolin
#deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precise/main/binary-i386/
#deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precise/restricted/binary-i386/
#deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ precise main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted