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
/** | |
* Adam Theme / Dark Theme | |
* Standard Layout for Spotify Client | |
* Defines the basic styles for an app | |
* @copyright 2011 by Spotify | |
*/ | |
/** | |
* Declarations for Adam Theme | |
* |
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 debian | |
RUN apt-get update && apt-get install -y git xz-utils python3 curl && rm -rf /var/lib/apt/lists/* | |
RUN git clone https://github.com/emscripten-core/emsdk.git && cd /emsdk && ./emsdk install latest-arm64-linux && ./emsdk activate latest-arm64-linux | |
ENTRYPOINT ["/emsdk/docker/entrypoint.sh"] |
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
[package] | |
name = "nomtest" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
nom = "7.1.3" | |
tempfile = "3.5.0" |
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
scale([4, 4, 1]) { | |
translate([20, 20, 0]) {linear_extrude (height=1) {circle(26);}}; | |
color([0, 0, 0]) { | |
translate([0, 26, 0]) { linear_extrude (height=3){import("wifi.svg"); }; } | |
translate([2, 15, 1]) { linear_extrude (height=1){rotate(90){text("wifi", size=5); }}; } | |
translate([43, 12, 1]) { linear_extrude (height=1){rotate(90){text("hs3.pl", size=5); }}; } | |
translate([16, -2, 1]) { linear_extrude (height=1){text("QR", size=5); }; } | |
translate([28, 43, 1]) { linear_extrude (height=1){rotate(180)text("NFC", size=5);}; } | |
} | |
} |
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
TEMPDIR="$(mktemp -d)" | |
NR_WORDS=${1:-3} | |
cd "$TEMPDIR" | |
curl 'https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english.txt' | grep -E "^.{4,8}$" | sort | uniq > wordlist.txt | |
NR_LINES="$(wc -l wordlist.txt | grep -oe '\d\+')" | |
POSS="$(echo "$NR_LINES^$NR_WORDS" | bc)" | |
BITS="$(echo "l($POSS)/l(2)" | bc -l)" | |
CHARS="$(echo "l($POSS)/l(72)" | bc -l)" | |
printf 'We have %d lines; we willl take %d words; there are %.3e possibilities (%.1f bits of entropy, comparable to %.1f completely random chars (lower/upper/number/special))\n' "$NR_LINES" "$NR_WORDS" "$POSS" "$BITS" "$CHARS" | |
if [[ $NR_LINES -lt "4000" ]]; then |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta | |
name="viewport" | |
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" | |
/> | |
<title>reveal.js</title> |
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
; run `sandbox-exec -f limit.sb $program` | |
(version 1) | |
(debug deny) | |
(deny default) | |
(import "/System/Library/Sandbox/Profiles/bsd.sb") | |
(allow network-outbound) | |
(deny network-outbound (remote tcp "localhost:*")) | |
(allow process-fork) | |
(allow process-exec* | |
(subpath "/opt/homebrew/") |
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
{ | |
"coord": { | |
"lon": -0.13, | |
"lat": 51.51 | |
}, | |
"weather": [ | |
{ | |
"id": 300, | |
"main": "Drizzle", | |
"description": "light intensity drizzle", |
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
// typescript versions of https://stackoverflow.com/a/56592365/1207489 | |
const pick = <T extends {}, K extends keyof T>(obj: T, ...keys: K[]) => ( | |
Object.fromEntries( | |
keys | |
.filter(key => key in obj) | |
.map(key => [key, obj[key]]) | |
) as Pick<T, K> | |
); | |
const inclusivePick = <T extends {}, K extends (string | number | symbol)>( |
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
import numpy as np | |
def rgb_to_hls(rgb_array: np.ndarray) -> np.ndarray: | |
""" | |
Expects an array of shape (X, 3), each row being RGB colours. | |
Returns an array of same size, each row being HLS colours. | |
Like `colorsys` python module, all values are between 0 and 1. | |
NOTE: like `colorsys`, this uses HLS rather than the more usual HSL | |
""" |
NewerOlder