These rules are adopted from the AngularJS commit conventions.
- Allow generating CHANGELOG.md by script
- Provide better information when browsing git history
function uriToBlob(dataURI, type) { | |
const binary = atob(dataURI.split(',')[1]); | |
const array = []; | |
for (let i = 0; i < binary.length; i++) { | |
array.push(binary.charCodeAt(i)); | |
} | |
return new Blob([new Uint8Array(array)], { type }); | |
} |
#!/usr/bin/env node | |
var fs = require('fs'); | |
var path = require('path'); | |
var sass = require('node-sass'); | |
var ENV = process.env.SASS_ENV || 'development'; | |
var file = 'variables.scss'; | |
//if in dev, directly pass file to sass | |
if (ENV === "development") { |
{"lastUpload":"2018-12-15T03:33:14.576Z","extensionVersion":"v3.2.4"} |
These rules are adopted from the AngularJS commit conventions.
The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:
const express = require('express') | |
const router = express.Router() | |
const auth = require('../auth') | |
router.use('/login/callback/github', | |
auth.authenticate('github', { failureRedirect: '/' }), | |
function(req, res) { | |
res.redirect('/') | |
}); |
// Adapted from: http://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect/1968345#1968345 | |
function line_intersects(p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) { | |
var s1_x, s1_y, s2_x, s2_y; | |
s1_x = p1_x - p0_x; | |
s1_y = p1_y - p0_y; | |
s2_x = p3_x - p2_x; | |
s2_y = p3_y - p2_y; | |
var s, t; |
// context | |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://...'); | |
/** | |
* Generates Mongoose uniqueness validator | |
* | |
* @param string modelName | |
* @param string field | |
* @param boolean caseSensitive |