This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Color palettes that actually look good from 1 .. 12 colors | |
# Taken from: https://blog.graphiq.com/finding-the-right-color-palettes-for-data-visualizations-fcd4e707a283 | |
graphiq <- function (n, option = 'warm') { | |
if (n < 1 || n > 12) stop('colors only defined for n = 1..12'); | |
if (option == 'warm') { | |
return(switch(n, | |
c("#FDB25F"), | |
c("#FFC96B", "#F47942"), | |
c("#FFC96B", "#F47942", "#AB412C"), | |
c("#FFD773", "#F99851", "#EF5833", "#923E2D"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ffi = require('ffi') | |
--local lib = ffi.load('libraylib.2.0.0.dylib') | |
local lib = ffi.load('libraylib') | |
ffi.cdef[[ | |
// Vector2 type | |
typedef struct Vector2 { | |
float x; | |
float y; | |
} Vector2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
run-async() { | |
local joblist=($(jobs -p)) | |
while (( ${#joblist[*]} >= 4 )); do # set 4 to the maximum number of jobs you want | |
sleep 0.1 | |
joblist=($(jobs -p)) | |
done | |
if [[ $# -eq 0 ]]; then # start shell with provided input if no arguments | |
local code="$(</dev/stdin)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Sequence, List, NamedTuple, Optional | |
from pprint import pprint | |
from os import getenv | |
import json | |
import random | |
import requests | |
import sys | |
class Person(NamedTuple): | |
name: str |