Skip to content

Instantly share code, notes, and snippets.

View jaawerth's full-sized avatar

Jesse Wertheim jaawerth

View GitHub Profile
@jaawerth
jaawerth / vim cheatsheet.md
Created November 4, 2016 05:51 — forked from jessedearing/vim cheatsheet.md
Vim Cheatsheet

#Vim Cheat Sheet

  • gqip - Reformats paragraph to textwidth
  • gq - Reformats selection
  • :Tab /= - Equally spaces based on the = symbol (requires Tabular vim plugin)
  • :setf language - Changes current language
  • :set language=language - Changes current language
  • <C-a> - Increments the number under the cursor
  • <C-x> - Decrements the number under the cursor
  • ~ - Toggles case and moves to next character in normal mode
'use strict';
const fetch = require('./fetch');
module.exports = function fetchMW(req, res, next) {
fetch(req.query.shape_id, (err, results) => {
if (err) {
return next(err);
} else {
req.dbResults = results;
/*
Usage:
1. Place loader in a webpack loader directory
2. Add the following to webpack loader configuration:
{ test: /angular(\.min)?\.js/, loader: 'angular-remove-di' },
*/
function removeAngularDI(angular) {
/*
Usage:
1. Place loader in a webpack loader directory
2. Add the following to webpack loader configuration:
{ test: /\.js/, loader: 'angular-es6-interop', exclude: /node_modules|jquery|angular(\.min)?\.js|\.build/}
*/
function findAll(regex, string, unique) {
// with defined properties
function accessors(index) {
return {
enumerable: true, configurable: false,
get: function() { return this._value[index]; },
set: function(value) { this._value[index] = value; }
};
}
function defineTypeWithDefinedProperties(fields) {
cleanUpOriginList(){
var i;
for (i = this.originList.length; i--;) {
delete this.originList[i].id;
delete this.originList[i].createdBy;
delete this.originList[i].modifiedBy;
delete this.originList[i].createdDate;
delete this.originList[i].createdDate;
delete this.originList[i].modifiedDate;
if (this.originList[i].targetName === '') {