Skip to content

Instantly share code, notes, and snippets.

View rgbkrk's full-sized avatar
🌎
Think globally, act locally

Kyle Kelley rgbkrk

🌎
Think globally, act locally
View GitHub Profile
@xjamundx
xjamundx / blog-webpack-2.md
Last active November 7, 2024 13:10
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@rgbkrk
rgbkrk / jupyter-in-the-javascript-universe.md
Last active December 7, 2015 13:08
Jupyter in the JavaScript Universe

The Jupyter and IPython projects have been around more than 10 years and a lot has changed over the years in terms of frontend development: V8, Node, npm, transpilers, JS Compilers, competing module loading systems, auto-updating browsers, new frameworks, and many other bits. They've all come and made front end development much better. At the same time, they've bred complexity in choice and decisions. Some of the biggest warts have been the document API for the DOM, how we work on it, the tendency to get addicted to the ease of jQuery, and the resulting jQuery soup that gets created. Large projects have to make a choice on how they're going to package and ship components of their overall application.

There was a time at which I was comfortable in CoffeeScript. Now that I've read JavaScript the Good Parts, Node.js the Right Way, read and written [more](https://github.com/nteract/jupyter-sideca

@gaearon
gaearon / slim-redux.js
Last active June 29, 2026 20:50
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@br3tt
br3tt / helpers.js
Last active December 5, 2015 16:37
class Helpers {
currentHP(db) { return db.PlayerInfo.CurrHP }
noCurrentHPGain(db) { return db.PlayerInfo.CurrentHPGain == 0.0 }
radiation(db) { return db.PlayerInfo.TotalDamages[5].Value }
aidItems(db) { return db.Inventory['48'] }
radiationMoreThan(rads) {
return db => {
this.radiation(db) > rads;
};
#!/bin/bash
# Assumes a pre-built carina cluster, e.g.:
#
# carina create --wait shipyard \
# && carina credentials shipyard \
# && eval `carina env shipyard`
#
@ivanoats
ivanoats / jqh.js
Created December 10, 2015 04:32
Hyperscript for jQuery
// hyperscript for jQuery
// create nested HTML elements with a DSL
// used to create reusable, interactive HTML components
//
// based on the many implentations out there like
// https://github.com/dominictarr/hyperscript
// https://github.com/Matt-Esch/virtual-dom/tree/master/virtual-hyperscript
// and Elm https://github.com/evancz/elm-html
var $h = function(element, properties, content) {
var $component = $('<' + element + '>');
@kevana
kevana / create-machines.sh
Last active February 26, 2016 03:49
dvm + machine: Easy testing for apps that support multiple Docker versions
# create docker-machines and use dvm to switch client binaries.
docker-machine create \
--driver=virtualbox \
--virtualbox-boot2docker-url=https://github.com/boot2docker/boot2docker/releases/download/v1.10.2/boot2docker.iso \
1.10.2-dev
docker-machine create \
--driver=virtualbox \
--virtualbox-boot2docker-url=https://github.com/boot2docker/boot2docker/releases/download/v1.9.1/boot2docker.iso \
console.log('Hello LabJack')
var ljn = require('labjack-nodejs');
var NanoTimer = require('nanotimer')
var fs = require('fs')
var now = require('performance-now')
var path = require('path')
var mkdirp = require('mkdirp').mkdirp
@btroncone
btroncone / rxjs_operators_by_example.md
Last active May 3, 2026 02:38
RxJS 5 Operators By Example
@nolanlawson
nolanlawson / parens-and-perf-counterpost.md
Last active August 14, 2023 20:08
"Parens and Performance" – counterpost

"Parens and Performance" – counterpost

Kyle Simpson (@getify) wrote a very thoughtful post decrying optimize-js, which is a tool I wrote that exploits known optimizations in JavaScript engines to make JS bundles parse faster (especially minified bundles, due to what could be reasonably described as a bug in Uglify).

Kyle lays out a good case, but I tend to disagree with nearly all his points. So here's my rebuttal.