Skip to content

Instantly share code, notes, and snippets.

@joyexpr
joyexpr / README.md
Created February 1, 2023 08:51 — forked from joyrexus/README.md
RAF replacements for setTimeout and setInterval

Drop in replace functions for setTimeout and setInterval that make use of requestAnimationFrame.

See overview article and Paul Irish's earlier post.

Courtesty of Joe Lambert

Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@joyexpr
joyexpr / mongoose-encrypted-schematype-field.md
Created September 5, 2022 06:35 — forked from kljensen/mongoose-encrypted-schematype-field.md
Encrypt a text field in Mongoose MongoDB ORM

Encrypting text fields in Mongoose is easy using Node's built-in crypto module. You might want to do this if you're using MongoDB as a service (see the recent MongoHQ security breach); or, if you're storing OAuth tokens that could, in the wrong hands, screw with somebody's account on a 3rd party service. (Of course, you should never encrypt passwords: those should be hashed.)

Imagine you have a Mongoose model like that shown below, which is modified only slighly from the example on the MongooseJS homepage.

var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');

var User = mongoose.model('User', {
 name: String,

GitHub从零单排第二期

  • [前端细节美化][1]
  • [GitHub黑魔法集合][2]
  • [JavaScript教程][3]
  • [开源写作工具][4]
  • [前端学习资源大集合][5]
  • [Go、Python、C][6]
  • [Python设计模式集合][7]
  • [安卓开发者中文文档][8]