Skip to content

Instantly share code, notes, and snippets.

View chrisabrams's full-sized avatar

Chris Abrams chrisabrams

  • New York, NY
View GitHub Profile
@chrisabrams
chrisabrams / bundleAnalysis.js
Created September 23, 2017 16:01 — forked from kanavarora/bundleAnalysis.js
Simple utility to track your bundle/chunk sizes with each release
/*
Utility to analyze bundle chunks over versions.
Assumes: webpack has already created the bundle summary json file -> stats.json
Parameters:
version: (Optional) a string that labels the current bundle with the version
provided and saves the summary in a csv file.
Output:
If run the first time, generates a csv file bundleAnalaysis.csv, which
@nerdyman
nerdyman / resolve-tsconfig-path-to-webpack-alias.js
Last active June 7, 2024 17:16
Convert TypeScript tsconfig paths to webpack alias paths
const { resolve } = require('path');
/**
* Resolve tsconfig.json paths to Webpack aliases
* @param {string} tsconfigPath - Path to tsconfig
* @param {string} webpackConfigBasePath - Path from tsconfig to Webpack config to create absolute aliases
* @return {object} - Webpack alias config
*/
function resolveTsconfigPathsToAlias({
tsconfigPath = './tsconfig.json',
@kanavarora
kanavarora / bundleAnalysis.js
Last active June 7, 2019 08:24
Simple utility to track your bundle/chunk sizes with each release
/*
Utility to analyze bundle chunks over versions.
Assumes: webpack has already created the bundle summary json file -> stats.json
Parameters:
version: (Optional) a string that labels the current bundle with the version
provided and saves the summary in a csv file.
Output:
If run the first time, generates a csv file bundleAnalaysis.csv, which
@nicolasbernard
nicolasbernard / docker-k8s.sh
Created March 26, 2016 12:25
How to install Docker/k8s from scratch on OSX
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # install HomeBrew
brew tap caskroom/cask # install Cask
brew cask install virtualbox # install VirtualBox
brew install docker docker-machine # install Docker and Docker-machine
docker-machine create --driver virtualbox default # create a Docker VM named "default"
eval $(docker-machine env default) # set env var to tell Docker client to talk to our VM
docker version # Docker works, yay!
brew tap redspread/spread # tell HomeBrew where Spread is
brew install kubectl spread # install Kubectl and Spread
spread cluster start # ask Spread to start a k8s cluster with Docker client settings
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active June 10, 2024 15:16
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@benhowdle89
benhowdle89 / gist:9533185
Created March 13, 2014 17:41
Gulp + Watchify + Browserify + Handlebars + LiveReload
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
var livereload = require('gulp-livereload');
var hbsfy = require("hbsfy").configure({
extensions: ["html"]
});
gulp.task('watch', function() {
@tuxracer
tuxracer / stop-timers.coffee
Created February 16, 2014 00:20
Stop timers on dispose of chaplin views, controllers, models, and collections
# Using @setTimeout or @setInterval will clear the timers on dispose
# Mixin, can be used with https://github.com/HubSpot/mixen
start = (type, args) ->
unless @disposed
method = window["set#{type}"]
timer = method.apply window, args
@timers[type].push timer
timer
@chrisabrams
chrisabrams / test.coffee
Last active December 20, 2015 19:09
Write console.logs from your app/tests running in Mocha to a file.
fs = require 'fs'
util = require "util"
log = fs.createWriteStream(process.cwd() + "/test/stdout.log")
console.log = console.info = (t) ->
out = undefined
if t and ~t.indexOf("%")
out = util.format.apply(util, arguments)
process.stdout.write out + "\n"
return
else
@maccman
maccman / jquery.ajax.queue.coffee
Last active January 13, 2018 12:03
Queueing jQuery Ajax requests. Usage $.ajax({queue: true})
$ = jQuery
queues = {}
running = false
queue = (name) ->
name = 'default' if name is true
queues[name] or= []
next = (name) ->
@chrisabrams
chrisabrams / rabbitmq-install-osx.md
Created May 1, 2012 17:32 — forked from jch/rabbitmq-install-osx.md
Troubleshooting RabbitMQ installation on OSX via homebrew

Troubleshooting RabbitMQ installation on OSX via homebrew

brew update
brew install rabbitmq

To see if rabbitmq is running after following the installation instructions:

launchctl list | grep rabbit
> 48303	-	homebrew.mxcl.rabbitmq