This file contains 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
// trying to confuse my mind (and i think i made it jeje!) | |
(function(moom){ | |
moom('moom'); | |
moom.moomoom = function(moom){ | |
return moom(moom); | |
}; | |
moom.moomoom(function(moom){ | |
moom(function(){ | |
console.log('moom'); |
This file contains 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
// lastMod.js | |
module.exports = exports = function lastModifiedPlugin (schema, options) { | |
schema.add({ lastMod: Date }) | |
schema.pre('save', function (next) { | |
this.lastMod = new Date | |
next() | |
}) | |
if (options && options.index) { |
This file contains 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
/** | |
* Created with JetBrains WebStorm. | |
* User: ynonperek | |
* Date: 1/28/13 | |
* Time: 9:14 PM | |
* | |
* Mongoose plugin that adds a hashed password field | |
*/ | |
var bcrypt = require('bcrypt'); |
This file contains 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
public string digits() | |
{ | |
var bytes = new byte[4]; | |
var rng = RandomNumberGenerator.Create(); | |
rng.GetBytes(bytes); | |
uint random = BitConverter.ToUInt32(bytes, 0) % 100000000; | |
return String.Format("{0:D8}", random); | |
} |
This file contains 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
public sealed class Mapper | |
{ | |
public delegate void Rule<F, T>(F from, T to) | |
where F : class | |
where T : class; | |
public static T Map<F, T>(F primary, params Rule<F, T>[] rules) | |
where F : class | |
where T : class | |
{ |
This file contains 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
public class Transverser { | |
private String rawJson; | |
private Object parsedJson; | |
private final String PATH_TOKEN = '/'; | |
private final String FILTER_START_TOKEN = '['; | |
private final String FILTER_END_TOKEN = ']'; | |
private final String COMBO_START_TOKEN = '('; | |
private final String COMBO_END_TOKEN = ')'; |
This file contains 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
``THE ROBOT AND THE BABY'' | |
A story by John McCarthy | |
``Mistress, your baby is doing poorly. He needs your attention.'' | |
``Stop bothering me, you fucking robot.'' | |
``Mistress, the baby won't eat. If he doesn't get some human love, the Internet pediatrics book says he will die.'' | |
``Love the fucking baby, yourself.'' |
This file contains 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
function stepsToPosition(a, b){ | |
var limit = 1000; | |
var steps = 0; | |
var o = {}; | |
var x = 0, y = 0; | |
var moves = 3; | |
for(var i = 0; i < limit; i++) { | |
var r = (x < a) ? (x + 2 < a ? 2 : 1) : 1; |
This file contains 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
List<ObjectPermissions> permissionSetAssignmentIds = [SELECT ParentId | |
FROM ObjectPermissions | |
WHERE | |
PermissionsCreate = True AND | |
PermissionsRead = True AND | |
PermissionsEdit = True AND | |
PermissionsDelete = False AND | |
PermissionsViewAllRecords = False AND | |
PermissionsModifyAllRecords = False AND |
This file contains 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
function toggleClass(elemenet, className){ | |
var classList = elemenet.className.split(' '); | |
var indexOfClassName = classList.indexOf(className); | |
if(indexOfClassName > -1) classList.splice(indexOfClassName, 1); | |
else classList.push(className); | |
elemenet.className = classList instanceof Array ? classList.join(' ') : classList; | |
} |
OlderNewer