Skip to content

Instantly share code, notes, and snippets.

View jaawerth's full-sized avatar

Jesse Wertheim jaawerth

View GitHub Profile
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 === '') {
// 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) {
/*
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) {
/*
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) {
'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;
@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
@jaawerth
jaawerth / CreateCustomField.xml
Created July 7, 2017 17:54 — forked from wadewegner/CreateCustomField.xml
Examples of HTTP requests and responses for Salesforce SOAP and Metadata API calls.
POST https://na15.salesforce.com/services/Soap/m/29.0/00Di0000000icUB HTTP/1.1
SOAPAction: create
Content-Type: text/xml; charset=utf-8
Host: na15.salesforce.com
Content-Length: 894
Expect: 100-continue
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:apex="http://soap.sforce.com/2006/08/apex" xmlns:cmd="http://soap.sforce.com/2006/04/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
@jaawerth
jaawerth / pipe.ts
Created February 23, 2018 15:12 — forked from slikts/pipe.ts
const pipe = <T, K>(
iterable: IterableIterator<T>,
seed: K,
fn: (a: T) => K
): T => {
const iterator = iterable[Symbol.iterator]()
if (iterable instanceof GeneratorFunction) {
iterator.next()
}
let result = iterator.next(seed)
const express = require('express')
const app = express()
var bodyParser = require('body-parser')
// knex
const environment = process.env.NODE_ENV || 'development';
const configuration = require('./knexfile')[environment];
const database = require('knex')(configuration);
@jaawerth
jaawerth / INSTALL.md
Created August 3, 2018 18:55 — forked from namuol/INSTALL.md
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.