This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Keybase proof | |
| I hereby claim: | |
| * I am marclar on github. | |
| * I am marclar (https://keybase.io/marclar) on keybase. | |
| * I have a public key whose fingerprint is 544C 62DF 992B 7384 65ED D227 C62E 5BEB A128 AC5A | |
| To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var myApp = angular.module('myApp').config(function($httpProvider) { | |
| $httpProvider.defaults.headers.post['X-CSRFToken'] = $('input[name=csrfmiddlewaretoken]').val(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Assuming "app.io" is your socket.io object.... | |
| app.io.configure(function (){ | |
| //On handshake, | |
| app.io.set('authorization', function (handshake, accept) { | |
| //Require headers | |
| if(handshake.headers){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Add "ifok" function | |
| global.ifok = function(args, msg, cb){ | |
| var me = this; | |
| args = Array.prototype.slice.call(args); | |
| var err = args.shift(); | |
| var log = (me.log || console.log); | |
| //You can comment out a log message by adding a space at the beginning | |
| if(msg.length && msg.charAt(0) === ' '){ | |
| msg = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mongodb = require('mongodb'); | |
| var mongoose = require('mongoose'); | |
| var id = '51a11f2d4da20b020000000a'; | |
| var mongooseId = new mongoose.Types.ObjectId(id); | |
| var mongoId = new mongodb.ObjectID(id); | |
| var logs = []; | |
| if(mongoId == mongooseId){ | |
| logs.push('mongoId == mongooseId'); | |
| } | |
| else{ |
NewerOlder