Skip to content

Instantly share code, notes, and snippets.

@wayspurrchen
wayspurrchen / server.js
Created October 22, 2014 20:05
Thin Node.js proxy server for front-end-only SPAs that need to make CORS requests
// 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,
var categories = [
{
id: 0,
name: 'Shoes',
imageUrl: 'alkfaekfja0-43i'
},
{
id: 1,
name: 'Clothing',
imageUrl: 'someshit'
@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 <SuperPaintmanDeveloper@gmail.com>
#
###
# Constants
###
RETVAL=0
@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 () {' ||
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 / 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 / gist:b6fd4eb085edf54406b7
Last active January 20, 2024 22:49
Web Performance Optimization Techniques