Skip to content

Instantly share code, notes, and snippets.

@erichosick
erichosick / mech-scope-cell-demo
Last active August 29, 2015 14:08
Gist of stuff done in youtube video here: http://youtu.be/3gSiYtBEMjY
First Setup (command Line):
mkdir mech
cd mech
npm install mech-core
npm install mech-scope-cell
npm install mech-math
npm install mech-emit
node
@erichosick
erichosick / gist:e772c438058b3b18dfbc
Created January 10, 2015 16:38
S3 Image Upload Stuff
// see https://github.com/CollectionFS/Meteor-cfs-s3
// see http://help.modulus.io/customer/portal/articles/1653448-file-storage
// - /app-storage/tmp vs /mnt/data/tmp ? app-storage is permanent
FS.debug = true;
FS.HTTP.setBaseUrl('/media');
FS.HTTP.setHeadersForGet([
['Cache-Control', 'public, max-age=31536000']
]);
var settings = {};
@erichosick
erichosick / js
Last active September 29, 2020 22:43
Configuration Context
// The root of the configuraton file is scoped to the
// entire company: all software offerings.
{
// The Platform context contains all services and
// applications for a specific product offering.
"platform": {
// The Compute context provides configuration
// to a specific application, service, mciro-service,
// lambda, etc.
"compute": {
@erichosick
erichosick / gen_random_uuid-vs-uuid_generate_v1.sql
Last active September 23, 2022 16:45
Benchmark of gen_random_uuid versus uuid_generate_v1
-- You must run the benchmark schema localed in
-- https://gist.github.com/erichosick/eeadc41e33ea2a91bd136b9433e73dc7
-- before running the following benchmark
DO $$
DECLARE d_exec_count int = 20;
DECLARE d_left_sql text;
DECLARE d_right_sql text;
BEGIN
-- You must run the benchmark schema localed in
-- https://gist.github.com/erichosick/eeadc41e33ea2a91bd136b9433e73dc7
-- before running the following benchmark
DO $$
DECLARE d_exec_count int = 20;
DECLARE d_left_sql text;
DECLARE d_right_sql text;
DECLARE d_up_sql text;
DECLARE d_down_sql text;
-- You must run the benchmark schema localed in
-- https://gist.github.com/erichosick/eeadc41e33ea2a91bd136b9433e73dc7
-- before running the following benchmark
DO $$
DECLARE d_exec_count int = 20;
DECLARE d_left_sql text;
DECLARE d_right_sql text;
DECLARE d_up_sql text;
DECLARE d_down_sql text;
-- EXTENSIONS ------------------------------------------------------------------
-- Supports uuid type and generating uuid
-- https://www.postgresql.org/docs/current/uuid-ossp.html
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- Supports cryptographic functions
-- https://www.postgresql.org/docs/current/pgcrypto.html
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
-- You must run the benchmark schema localed in
-- https://gist.github.com/erichosick/eeadc41e33ea2a91bd136b9433e73dc7
-- before running the following benchmark
DO $$
DECLARE d_exec_count int = 20;
DECLARE d_row_count int = 3e6;
BEGIN
CALL benchmark.execute(