Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
var $ = require('cheerio'), | |
_ = require('underscore'), | |
request = require('request'), | |
// If you want to create a file | |
images = [], | |
path = require('path'), | |
dir = path.join(__dirname,'\Templates'), | |
fs = require('fs'), | |
GetImage = function(file){ | |
var HtmlFile = fs.readFileSync(file).toString(), |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/app'); | |
var usrSchema = new mongoose.Schema({ | |
user: { type: String, required: true }, | |
password: { type: String, required: true }, | |
DLU: { type: Date } | |
}); | |
var bcrypt = require('bcrypt-nodejs'), | |
sqlite3 = require('sqlite3').verbose(); | |
var file = 'content/data/ghost-dev.db'; | |
var db = new sqlite3.Database(file); | |
var password = 'YOUR_NEW_PASSWD'; | |
bcrypt.hash(password, null, null, function(err, hash) { | |
db.serialize(function() { | |
db.run("UPDATE users SET password = ? WHERE id = ?", hash, 1); |
/** | |
* Module dependencies. | |
*/ | |
var pkg = require('../package'); | |
var env = process.env.NODE_ENV || 'development'; | |
/** | |
* Return setting `name`. | |
* |
// Joins path segments. Preserves initial "/" and resolves ".." and "." | |
// Does not support using ".." to go above/outside the root. | |
// This means that join("foo", "../../bar") will not resolve to "../bar" | |
function join(/* path segments */) { | |
// Split the inputs into a list of path commands. | |
var parts = []; | |
for (var i = 0, l = arguments.length; i < l; i++) { | |
parts = parts.concat(arguments[i].split("/")); | |
} | |
// Interpret the path commands to get the new resolved path. |
// MIT: http://opensource.org/licenses/MIT | |
angular.module('app', []); | |
angular.module('app').controller | |
( 'MainCtrl' | |
, function($scope,$locale) { | |
$scope.currentYear = new Date().getFullYear() | |
$scope.currentMonth = new Date().getMonth() + 1 | |
$scope.months = $locale.DATETIME_FORMATS.MONTH |
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |