Skip to content

Instantly share code, notes, and snippets.

View dypsilon's full-sized avatar

Tim Navrotskyy dypsilon

View GitHub Profile
@dypsilon
dypsilon / callback_pattern.js
Last active April 28, 2024 08:53
The callback pattern found in many node.js functions.
var invokee1 = function(err, callback) {
// cant change this function
callback();
};
var invokee2 = function(err, optional1, optional2, callback) {
// work with optional 1 or optional 2
console.log(optional1);
console.log(optional2);
// cant change this function
var dust = require('dustjs-linkedin'),
express = require('express'),
cons = require('consolidate');
app.engine('dust', cons.dust);
app.set('view engine', 'dust');
app.set('views', __dirname + '/theme/dust');
app.use(express.static(__dirname + '/theme'));
// the test fails but there is no description about what happened
request.post('/endpoint').expect(200).end(function(err, res) {
if (err) return done(err);
res.body.email.should.be.a('string');
res.body.email.should.equal('[email protected]');
done();
});

Rich Text Editing

External Links

  • WYSIWYG HTML
    • TinyMCE
      • looks like bootstrap
      • license: LGPL
      • integrates with Plupload for file uploading (PHP only)
  • integrates with MoxieManager for file management (PHP only)
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active October 26, 2025 08:45
A badass list of frontend development resources I collected over time.
var composer = new Hapi.Composer(nconf.get('manifest'));
composer.compose(function(err) {
if (err) {
console.log('Failed composing.');
console.log(err);
exit(1);
}
composer.start(function() {
@dypsilon
dypsilon / async-hapi-plugin-example.js
Created October 22, 2013 10:00
This is a simple plugin for a mongodb connection.
var lib = require('mongodb');
var MongoClient = require('mongodb').MongoClient;
var ObjectID = require('mongodb').ObjectID;
var _ = require('lodash');
exports.register = function(plugin, options, next) {
MongoClient.connect(options.url, function(err, db) {
if(err) return next(new Error('Could not connect to the mongodb: ' + err));