Skip to content

Instantly share code, notes, and snippets.

NOTE duplicate id 1545839157538981467
https://api-staging.realmassive.com/leases?sort=-updated&page[limit]=10&page[offset]=10
{
"meta":{
"count":125317
},
"data":[
{
"relationships":{
@wayspurrchen
wayspurrchen / iifestrip.js
Created September 15, 2016 15:30
Strip IIFEs from files in a directory. You'll need minimist and recursive-readdir. Doesn't work on IIFEs that have args passed in
var fs = require('fs');
var path = require('path');
var recursive = require('recursive-readdir');
var argv = require('minimist')(process.argv.slice(2));
var iifepath = path.resolve(process.cwd(), argv.path);
function isIIFEStart (string) {
// whatever you don't know my life
return string === '(function () {' ||
@wayspurrchen
wayspurrchen / npm-f3-install.sh
Created September 2, 2016 18:15 — forked from SuperPaintman/npm-f3-install.sh
NPM install for low RAM machins. And "npm install ... killed" problem
#!/bin/bash
#
# Author: SuperPaintman <[email protected]>
#
###
# Constants
###
RETVAL=0
var categories = [
{
id: 0,
name: 'Shoes',
imageUrl: 'alkfaekfja0-43i'
},
{
id: 1,
name: 'Clothing',
imageUrl: 'someshit'
@wayspurrchen
wayspurrchen / injector.js
Last active January 9, 2016 05:37
demo code showing how AngularJS 1.6 injectors (probably) magically inject services by name
/**
* This gist shows how you can inject other functions/variables
* into a function only by name. I imagine this is probably something
* like how AngularJS 1.6 does it, but Angular relies on an internal
* list of registered modules instead of just whatever's floating
* around the namespace, which is dangerous.
**/
// Things to inject
function LoggerOne () {
@wayspurrchen
wayspurrchen / git patterns.md
Last active January 18, 2023 21:38
Useful Git Techniques

History

Show file at certain commit

git show <hash>:<file>

Show history of a file

git log -p <filename>

@wayspurrchen
wayspurrchen / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
function retry ( promiseToRetry, maxRetries ) {
return new Promise( function ( resolve, reject ) {
promiseToRetry.then( function ( resolve ) {
resolve( result );
} ).catch( function ( e ) {
if ( maxRetries > 0 ) {
return retry( promiseToRetry, maxRetries - 1 );
} else {
reject( e )
}
@wayspurrchen
wayspurrchen / gist:c688b2d9685418901791
Last active August 29, 2015 14:13
Grab and list all (unique) classes on page
var cls = [];
Array.prototype.slice.call( document.querySelectorAll('*'), 0 ).forEach( function ( el ) {
cls = cls.concat( Array.prototype.slice.call( el.classList, 0 ) );
} );
cls = cls.reduce( function ( p, c ) {
if ( p.indexOf( c ) < 0 ) p.push( c );
return p;
}, [] );
console.log( cls );