Skip to content

Instantly share code, notes, and snippets.

View edinella's full-sized avatar
🐝
“Nothing will work unless you do.” — Maya Angelou

Ezequias Dinella edinella

🐝
“Nothing will work unless you do.” — Maya Angelou
View GitHub Profile
@edinella
edinella / gist:4008209
Created November 3, 2012 18:32
Native fullscreen javascript api
addEventListener("click", function(){
var el = document.documentElement;
var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen;
rfs.call(el);
});
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@domenic
domenic / q-mongoose-so.js
Last active August 24, 2017 05:49
Q + Mongoose from StackOverflow
var mongoose = require('mongoose');
mongoose.connect('mongo://localhost/test');
var conn = mongoose.connection;
var users = conn.collection('users');
var channels = conn.collection('channels');
var articles = conn.collection('articles');
var insertUsers = Q.nfbind(users.insert.bind(users));
var insertChannels = Q.nfbind(channels.insert.bind(channels));
@logicalparadox
logicalparadox / About.md
Created January 8, 2012 07:01
Designing `loggable` custom error constructors for Node.js.

Custom Errors

I am working on a custom error constructor for my seed project. I had a few objectives in mind when I started.

  • When in production, these errors need to be able to be serialized for logging.
  • When in development, I can easily throw these errors should I need additional feedback on to what is going on.
  • Any addon plugins made can use or extend the custom error type and still satisfy the first two objective with ease.

Screenshot