Skip to content

Instantly share code, notes, and snippets.

View danieldietrich's full-sized avatar
💭
📡 working from space

Daniel Dietrich danieldietrich

💭
📡 working from space
View GitHub Profile
@danieldietrich
danieldietrich / gist:55b4f08fbe2720ea89954b216418d4ff
Created December 1, 2023 15:15 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@danieldietrich
danieldietrich / LLM.md
Created March 30, 2023 20:39 — forked from rain-1/LLM.md
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@danieldietrich
danieldietrich / launch.json
Created October 26, 2022 15:29
Langium Launch configuration
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
@danieldietrich
danieldietrich / thoughts.md
Last active October 18, 2022 12:48
The case of IsEmpty<T> versus universal types any, unknown and never

IsEmpty<T>

A value of type T is defined to be empty, if

  • it is an array and has no elements
  • it is an object and has no properties

Handling of universal types

  • any can be seen as the union of all types. A union distributes in conditional types, so any may or may not be empty. true | false = boolean
@danieldietrich
danieldietrich / attributions.md
Last active October 7, 2022 02:33
Traverse the type of an object tree, find leafs that are function types and collect the type of their first argument.
@danieldietrich
danieldietrich / 01_definition.md
Last active September 27, 2022 20:20
TypeScript: Conditional types are distributive over type parameters.

Def. A conditional type with a checked naked type parameter T is called distributive conditional types.

Example:

// given U, X and Y
type DistributiveConditionalType<T> = T extends U ? X : Y;

Distributive conditional types are automatically distributed over union types during instantiation.

@danieldietrich
danieldietrich / print256colours.sh
Created December 9, 2021 12:56 — forked from HaleTom/print256colours.sh
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@danieldietrich
danieldietrich / .bashrc
Last active December 11, 2021 05:44
Git prompt for shell
#
# Usage: `source <(curl -sL https://bashrc.danieldietrich.dev)`
#
export LANG=en_US.UTF-8
export LC_ALL=${LANG}
export TERM=xterm-256color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
@danieldietrich
danieldietrich / easing.js
Created October 8, 2020 22:14 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: t => t,
// accelerating from zero velocity
easeInQuad: t => t*t,
// decelerating to zero velocity
@danieldietrich
danieldietrich / publish-ghpages.md
Created October 7, 2020 01:24 — forked from tduarte/publish-ghpages.md
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref