Skip to content

Instantly share code, notes, and snippets.

View jreading's full-sized avatar

Johnny Reading jreading

View GitHub Profile
@shortjared
shortjared / list.txt
Last active April 11, 2025 14:12
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@dchowitz
dchowitz / es6-debugging-in-vscode.md
Last active August 30, 2023 06:23
Debugging ES6 in VS Code

Debugging ES6 in VS Code

My current editor of choice for all things related to Javascript and Node is VS Code, which I highly recommend. The other day I needed to hunt down a bug in one of my tests written in ES6, which at time of writing is not fully supported in Node. Shortly after, I found myself down the rabbit hole of debugging in VS Code and realized this isn't as straightforward as I thought initially. This short post summarizes the steps I took to make debugging ES6 in VS Code frictionless.

What doesn't work

My first approach was a launch configuration in launch.json mimicking tape -r babel-register ./path/to/testfile.js with babel configured to create inline sourcemaps in my package.json. The debugging started but breakpoints and stepping through the code in VS Code were a complete mess. Apparently, ad-hoc transpilation via babel-require-hook and inline sourcemaps do not work in VS Code. The same result for attaching (instead of launch) to `babel-node

@mathiasbynens
mathiasbynens / web-platform-status-links.md
Last active February 8, 2025 12:35
Web platform status links
@mandiwise
mandiwise / Count lines in Git repo
Last active May 1, 2025 06:01
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
19:42 alexspeller: spenguin: imagine the controller layer as a spiderweb with flies on
19:42 alexspeller: spenguin: controllers are like the webbing and the struggling flies are your data
19:43 spenguin: right
19:43 alexspeller: spenguin: the routing layer is the spider. The spider responds to the weather (i.e. URL changes, user input, websocket events, etc etc) by moving flies around (setting controller content to various data)
19:45 alexspeller: due to convention a lot of this is automatic (hitting /posts/1 will find Post id 1 and set the model property of the PostController to that post for example) but it doesn't have to be automatic
19:45 alexspeller: you can override setupController to set the post model to a different controller or you can override model hook so PostRoute finds a different model or multiple models or no model
19:46 alexspeller: the strands of the web are "needs". They connect controllers together.
19:48 alexspeller: So don't get confused by thinking there should always be a 1:1 relatio
@staltz
staltz / introrx.md
Last active May 6, 2025 07:45
The introduction to Reactive Programming you've been missing
@vladikoff
vladikoff / resource.js
Created April 17, 2014 17:52
Angular $resource and transformResponse
angular.module('itemServices', ['ngResource'])
.factory('Item', ['$resource',
function ($resource) {
return $resource('items/:id',
{id: '@id'},
{
query: {
isArray: true,
method: 'GET',
params: {},
@brittanydionigi
brittanydionigi / shifts.js
Created March 27, 2014 21:12
making people do my work for me
/* Some boys are playing a hockey game and they each play a certain number of shifts. */
/* For simplicity, we'll say there are 15 different shifts in a game. */
[
{
"player": "Joe",
"shifts": [
{ "shift_start": 3, "shift_end": 5 }, // Joe started playing at shift #3, and stopped after shift #5
{ "shift_start": 7, "shift_end": 11 }
]
everything i write on medium is a lie
xoxo j$
@tvandervossen
tvandervossen / environment.js
Last active April 2, 2024 20:18
Here’s an example of my current web app user agent, device, and/or feature detection approach. I tend to inline this in the page header just before the stylesheet as part of the distribution build. A benefit of this approach is that detection is done early without any external dependencies. It’s also straightforward to modify or extend while you…
env = (function() {
var flags = {}, ua = navigator.userAgent, el = document.createElement('div'), video = document.createElement('video'), audio = document.createElement('audio'), root = document.documentElement, i
function flag(names) {
names = names.split(' ')
for (i = 0; i < names.length; i++)
flags[names[i]] = true
}
function classnames() {
var names = [], name
for(name in flags) if (flags.hasOwnProperty(name))