Skip to content

Instantly share code, notes, and snippets.

@receptor
receptor / EventEmitter.js
Created January 27, 2017 16:25
Simple EventEmitter for browsers
// usage:
// EventEmitter.mixin(myObject)
// myObject.emit('eventname', param1, param2, etc)
// myObject.on('eventname', function(param1, param2, etc) {})
var EventEmitter = function () {};
EventEmitter.prototype = {
// add event handler
on: function (event, fn)
fs.exists(file, function (exists)
{
if (exists)
{
fs.stat(file, function (error, stats)
{
fs.open(file, "r", function (error, fd)
{
var buffer = new Buffer(stats.size);
fs.read(fd, buffer, 0, buffer.length, null, function (error, bytesRead, buffer)
@receptor
receptor / style.css
Created May 3, 2015 12:16
JQuery Moblile font-weight normal
.ui-btn,
.ui-btn h4,
html body .ui-group-theme-a .ui-bar-inherit,
html body .ui-group-theme-a a,
html body .ui-group-theme-b .ui-bar-inherit,
html body .ui-group-theme-b a,
label.ui-btn {
font-weight: normal !important;
}