Skip to content

Instantly share code, notes, and snippets.

View jbsulli's full-sized avatar

Joshua Sullivan jbsulli

  • Truepill
  • Austin, TX, USA
View GitHub Profile
jbsulli / pnp
Last active March 21, 2024 16:24
Typescript Yarn 3 Plug'n'Play zero-install monorepo for VSCode

Setup nvm

curl -o- | bash
source ~/.bashrc

Setup node

jbsulli / request.json
Last active March 10, 2020 21:22
Courier Firebase overrides
"data": {
"name": "Joshua"
"event": "my-event",
"recipient": "josh",
"override": {
"firebase-fcm": {
"body": {
"data": {
jbsulli / c_cpp_properties.json
Created October 2, 2019 19:15
VSCode ESP32 configuration
"configurations": [
"name": "Win32",
"includePath": [
"forcedInclude": [
jbsulli / extendObservable
Last active April 3, 2018 18:17
MobX 4 extendObservable issue

The Problem:

Given the folloowing code:

class Jedi {
  @observable firstName = "";
  @observable lastName = "";

  constructor(options) {


Spoiler warning

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

console.log("I'm a code block!");


  • document.querySelector(): returns first matching element
  • document.querySelectorAll(): returns all matching elements
  • document.getElementById(id)

DOM Node

  • addEventListener(event, cb)
  • appendChild(node)
  • childNodes
  • classList

What I learned - Image Resize on Cache Miss

The task:

I really wanted a way to create resized images on the fly just by specifying the size of the image in the request URL. So, if I had the image kitty.jpg but wanted to resize it to be 100px by 100px, would simply request kitty-100x100.jpg, the server would realize it doesn't exists and create it, and the resized image would be returned to me.

The solution:

I was following this guide written by John Pignata. It is an interesting solution and fit my needs but I did run into some caveats. Below are some of the gotchas I encountered.

1) There are two S3 domains you can point your CloudFront distribution at:

jbsulli /
Last active August 22, 2017 04:33
App Academy JumpStart Prep Notes


  • string
    • .chars.count: block receives each char and method will return the number of truthy results
    • .split
    • .each_char: block called for each char with the current char as the argument
    • .with_index: when used with .each_char, will add a second argument, index, passed to the block
  • number
    • .even?/.odd?
    • .abs
    • .floor, .ceil, .round
jbsulli / cmd.reg
Created May 16, 2017 02:38
Add "Open with CMD" option to the Windows 10 context menu (both when right-clicking on a folder and in a folder).
Windows Registry Editor Version 5.00
@="Open with CMD"
@="cmd.exe /k cd %V"
jbsulli /
Last active November 25, 2020 05:27
How to create a node command line integration module