Skip to content

Instantly share code, notes, and snippets.

View braedonwatkins's full-sized avatar
ballin'

Braedon Watkins braedonwatkins

ballin'
View GitHub Profile
@acidtone
acidtone / README.md
Last active May 19, 2024 15:56
Express: send() vs json() vs end()

Express: res.send() vs res.json() vs res.end()

Materials

Key Takeaways

  • When in doubt, use .send(). It dynamically sets Content-Type headers to match the data it sends.
  • When sending JSON, you can either use .json() uses .send().
    • .json() is arguably less confusing
  • .json() uses .send() under the hood so the resulting HTTP headers are the same.
@mul14
mul14 / profile.md
Created October 26, 2018 00:35 — forked from ezekg/profile.md
iTerm key bindings

Open the iTerm preferences ⌘+, and navigate to the Profiles tab (the Keys tab can be used, but adding keybinding to your profile allows you to save your profile and sync it to multiple computers) and keys sub-tab and enter the following:

Delete all characters left of the cursor

⌘+←Delete Send Hex Codes:

  • 0x18 0x7f – Less compatible, doesn't work in node and won't work in zsh by default, see below to fix zsh (bash/irb/pry should be fine), performs desired functionality when it does work.
  • 0x15 – More compatible, but typical functionality is to delete the entire line rather than just the characters to the left of the cursor.

Delete all characters right of the cursor

⌘+fn+←Delete or ⌘+Delete→ Send Hex Codes:

  • 0x0b
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active July 17, 2024 07:03 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@sma
sma / basic.js
Created January 9, 2016 15:14
A simple BASIC interpreter in JavaScript for an old D&D BASIC program
'use strict';
const source = `
1000 REM ***********************************************************
1010 REM * DUNGEON MASTER'S PERSONNEL SERVICE *
1020 REM * ( 40 COLUMN BY 16 LINE CRT DISPLAY ONLY ) *
1030 REM * SAVE AS "D&DCRT.BAS" - VERSION 1.2 *
1040 REM * *
1050 REM ***********************************************************
1060 REM * GENERATES PLAYER CHARACTERISTIC FOR FANTASY *