Skip to content

Instantly share code, notes, and snippets.

@phortuin
phortuin / postgres.md
Last active April 30, 2024 02:26
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql@14

(The version number 14 needs to be explicitly stated. The @ mark designates a version number is specified. If you need an older version of postgres, use postgresql@13, for example.)

@iandouglas
iandouglas / README.md
Last active March 21, 2024 12:44
Intro to Co-Authored Git Commits

Intro to Co-Authored Git Commits

Why

In student projects, I commonly look at contribution graphs to see how much code they worked on, to get an idea if one student is doing more work than others on the project. This can be used for coaching and performance grading.

How

Start with your ~/.gitconfig file in your home folder. Add these lines:

dialog {
position: fixed;
top: 50%;
left: 50%;
right: auto;
padding: 30px;
transform: perspective(500px) translate(-50%, -50%);
background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF;
border: none;
border-radius: 3px;
@slightlyoff
slightlyoff / push_payloads_userland.md
Last active September 30, 2022 23:11
Delivering H/2 Push Payloads To Userland

Background

One of the biggest missed opportunities thus far with HTTP/2 ("H/2") is that we are not yet able to sunset WebSockets in favor of H/2. Web Sockets and H/2 both support multiplexing messages bi-directionally and can send both textual and binary data.

Server Sent Events ("SSE"), by contrast, are not bi-directional (they're a "server-push-only" channel) and binary data cannot be sent easily. They are, however, very simple to implement. Adding to the menagerie of options, RTCPeerConnection can also be used to signal data to applications in a low-latency (but potentially lossy) way.

Because H/2 [does not support the handshake (upgrade) that WebSockets use to negotiate a connection](https://daniel.haxx.se/blog/2016/06/15/no-websockets-

@jpsc
jpsc / grunticon-without-grunt.json
Last active September 21, 2017 10:00
An example on how to run grunticon without grunt dependency
scripts {
"generate:icons": "npm-run-all icons:*",
"install-icon-generator": "npm i grunticon-cli phantomjs rimraf svgo",
"icons:optimize-svg": "svgo -f ./Views/Shared/Icons/RawIcons -o ./tmp ",
"icons:grunticon": "grunticon ./tmp ./Views/Shared/Icons/Assets --config=./Scripts/generate-icons/config.js",
"icons:clean": "rimraf ./tmp"
}
@jm3
jm3 / 7 Questions All Businesses Must Answer.md
Last active September 29, 2023 22:12
from Peter Thiel's book, Zero to One
pt Seven Questions All Businesses Must Answer
  1. The Engineering Question: Can you create breakthrough technology (vs. incremental improvement)?

  2. The Timing Question: Is now the right time to start this particular business?

  3. The Monopoly Question: Are you starting with a big share of a small market?

require.config({
paths: {
/* other paths are omitted */
'bootstrap': '../libs/bootstrap'
},
shim: {
'bootstrap/affix': { deps: ['jquery'], exports: '$.fn.affix' },
'bootstrap/alert': { deps: ['jquery'], exports: '$.fn.alert' },
'bootstrap/button': { deps: ['jquery'], exports: '$.fn.button' },
'bootstrap/carousel': { deps: ['jquery'], exports: '$.fn.carousel' },
@bloodyowl
bloodyowl / gist:4340751
Last active April 20, 2016 17:53
Smallest HTML5 shim ever

Smallest HTML5 shim ever

130 bytes, that's what it takes.

Script

"header footer section aside nav article figure figcaption hgroup time main".replace(/\w+/g,function(a){document.createElement(a)})