Skip to content

Instantly share code, notes, and snippets.

@joshlarsen
joshlarsen / app.js
Created March 19, 2019 18:38
Google Cloud Functions Node.js 8 Simple Emulator
/**
* Inspiration taken from here https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/258#issuecomment-413786762
* Alternative: https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/258#issuecomment-407996126
*
* Original: https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/258#issuecomment-437080813
*/
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
@joshlarsen
joshlarsen / irb.rb
Created January 9, 2019 19:04
Ruby backtrace in IRB
begin
# Some exception throwing code
rescue => e
puts "Error during processing: #{$!}"
puts "Backtrace:\n\t#{e.backtrace.join("\n\t")}"
end
@joshlarsen
joshlarsen / server.js
Created October 19, 2018 18:11
Simple node.js proxy with dynamic route lookups via Redis
const http = require('http');
const httpProxy = require('http-proxy');
const redis = require('redis');
// listen port
const port = 5050;
// redis client
const client = redis.createClient();