Skip to content

Instantly share code, notes, and snippets.

wayspurrchen / gist:b6fd4eb085edf54406b7
Last active Aug 19, 2022
Web Performance Optimization Techniques
View gist:b6fd4eb085edf54406b7
wayspurrchen / git
Last active Aug 28, 2021
Useful Git Techniques
View git


Show file at certain commit

git show <hash>:<file>

Show history of a file

git log -p <filename>

View duplicate_id :(
NOTE duplicate id 1545839157538981467[limit]=10&page[offset]=10
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 /
Created Sep 2, 2016 — forked from SuperPaintman/
NPM install for low RAM machins. And "npm install ... killed" problem
# Author: SuperPaintman <>
# Constants
View gist:3b86cff84cdafca6e9e6
var categories = [
id: 0,
name: 'Shoes',
imageUrl: 'alkfaekfja0-43i'
id: 1,
name: 'Clothing',
imageUrl: 'someshit'
wayspurrchen / server.js
Created Oct 22, 2014
Thin Node.js proxy server for front-end-only SPAs that need to make CORS requests
View server.js
// Node.js proxy server for CORS requests with single page, no-backend apps.
// Instructions:
// 1) Place file into your app directory
// 2a) If you don't have a package.json file in this directory, run "npm init" first
// 2b) Run "npm install --save express request query-string"
// 3) Run server with "node server.js"
// 4) Configure Express to use whatever folder you want to serve your site out of.
// By default, this will run out of whatever folder you have your server.js in,
// but you shouldn't do this since it'll make everything in this folder accessible,
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 () {