Skip to content

Instantly share code, notes, and snippets.

View marcusandre's full-sized avatar

Marcus André marcusandre

View GitHub Profile
// How do you avoid name clashes between functions, variables, components, and types?
// OK
const crocodiles = getCrocodiles({ color: 'green' })
// ???
const isCrocodile = isCrocodile(crocodiles[0])
// OK
const user: User = { name: 'Chuck Norris' }
@kconner
kconner / macOS Internals.md
Last active March 22, 2024 22:58
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@Fluepke
Fluepke / log_train.sh
Created November 12, 2022 15:16
Log train rides on german trains (location data, internet availability, speed, etc.)
#!/bin/bash
if ! command -v curl &> /dev/null; then
echo "This script needs curl. Please install curl."
exit -1
fi
if ! command -v jq &> /dev/null; then
echo "This script needs jq. Please install jq."
exit -1
;; Boot to PRINT10
;;
;; Use nasm to assemble the code to a binary:
;;
;; $ nasm -f bin -o boot.bin boot.nasm
;;
;; Use dd to make an empty floppy disk image:
;;
;; $ dd if=/dev/zero of=boot.flp ibs=1k count=1440
;;
@merlinmann
merlinmann / wisdom.md
Last active March 25, 2024 15:42
Merlin's Wisdom Project (Draft)

Merlin's Wisdom Project

Or: “Everybody likes being given a glass of water.”

By Merlin Mann.

It's only advice for you because it had to be advice for me.

@gordonbrander
gordonbrander / README.md
Last active April 25, 2023 20:38
microview - data-driven views that render once per frame, at most

Microview

What if... Virtual DOM... but by hand?
aha ha, just kidding...
unless.. ?

Microview is a tiny library for writing efficient data-driven DOM rendering logic by hand. DOM writes are driven by a pure data model. Using Microview, you can freely "bash the dom". Writes will be batched — they'll only happen once per animationframe, and only if the data model changes.

@lsloan
lsloan / Postman current timestamp for UTC as ISO 8601.md
Last active September 4, 2023 11:44
Postman current timestamp for UTC as ISO 8601

I wanted to know: How can I get the current timestamp for UTC in ISO 8601 format to appear in the body data of a Postman request?

After reading some of the Postman documentation and online comments, this is the solution (using Postman v5.0.1 for Chrome 58.0.3029.110 on macOS 10.12.5) I used:

  1. In the Builder, while editing a request, click the "Pre-request Script" heading below the URL field.

  2. In the editor field that appears, enter this single line of JavaScript:

    postman.setGlobalVariable('timestampUtcIso8601', (new Date()).toISOString());
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
Date: Wed Jan 11 2017 20:23:08 GMT+0100 (CET)
1. Console Hacking 2016 (24941)
2. SpiegelMining – Reverse Engineering von Spiegel-Online (22407)
3. Fnord-Jahresrückblick (18797)
4. Shut Up and Take My Money! (16545)
5. Where in the World Is Carmen Sandiego? (12774)
6. Security Nightmares 0x11 (10648)
7. How Do I Crack Satellite and Cable Pay TV? (9553)
8. Die Sprache der Populisten (9157)
@tj
tj / Connector.js
Last active November 26, 2019 15:43
import React from 'react'
const bgStyles = {
strokeWidth: 3,
strokeLinejoin: 'round',
strokeLinecap: 'round',
fill: 'none',
stroke: '#c3fdff'
}