Skip to content

Instantly share code, notes, and snippets.

Way Spurr-Chen wayspurrchen

Block or report user

Report or block wayspurrchen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View duplicate_id :(
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 Sep 15, 2016
Strip IIFEs from files in a directory. You'll need minimist and recursive-readdir. Doesn't work on IIFEs that have args passed in
View iifestrip.js
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 Sep 2, 2016 — forked from SuperPaintman/npm-f3-install.sh
NPM install for low RAM machins. And "npm install ... killed" problem
View npm-f3-install.sh
#!/bin/bash
#
# Author: SuperPaintman <SuperPaintmanDeveloper@gmail.com>
#
###
# Constants
###
RETVAL=0
View gist:3b86cff84cdafca6e9e6
var categories = [
{
id: 0,
name: 'Shoes',
imageUrl: 'alkfaekfja0-43i'
},
{
id: 1,
name: 'Clothing',
imageUrl: 'someshit'
@wayspurrchen
wayspurrchen / injector.js
Last active Jan 9, 2016
demo code showing how AngularJS 1.6 injectors (probably) magically inject services by name
View injector.js
/**
* 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 Jul 3, 2019
Useful Git Techniques
View git patterns.md

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 Aug 29, 2015 — 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.
View The Technical Interview Cheat Sheet.md

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.
View promiseretry.js
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 Aug 29, 2015
Grab and list all (unique) classes on page
View gist:c688b2d9685418901791
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 );
You can’t perform that action at this time.