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
/* Sass Code */ | |
html { | |
width: 100%; | |
body { | |
width: 50% | |
/* This would only be styled if body was in html */ | |
} | |
} |
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
/* Sass Code */ | |
@mixin phone { | |
@media screen and (min-width: 480px) { | |
@content; | |
} | |
} | |
@mixin tablet { | |
@media screen and (min-width: 768px) { | |
@content; |
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
/* Sass Code */ | |
$headerHeight: 15em; | |
header { | |
width: 100%; | |
height: $headerHeight; | |
padding: $headerHeight/4 5em; | |
} | |
/* Compiled CSS Code */ |
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
/* Sass Code */ | |
@import 'style_reset'; /* File Path must be relative | the style_reset.scss file is in the variables folder */ | |
html { | |
background: #fff; /* $blue was pulled in from the file above */ | |
} | |
/* Compiled CSS Code */ | |
html, body, ul, ol { /* The style_reset.scss file contents */ | |
margin: 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
/* Sass Code */ | |
@mixin vendor-prefix($name, $value) { /* Copy this mixin for your own use! */ | |
@each $vendor in ('-webkit-', '-moz-', '-ms-', '-o-', '') { | |
#{$vendor}#{$name}: #{$value}; | |
} | |
} | |
* { | |
@include vendor-prefix('box-sizing', 'border-box'); | |
} |
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
/** Makes a tuple of length `L` with each of the elements of type `T`. */ | |
export type Locked< | |
L extends number, | |
T, | |
$Draft extends unknown[] | readonly unknown[] = [] | |
> = | |
// jus making my ternaries look nicer in prettier | |
$Draft["length"] extends L | |
? $Draft // ship it | |
: $Draft["length"] extends 44 // it will overflow if it's larger than 44 so we need to do the hacky way |
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 { AES } from "https://deno.land/x/god_crypto/aes.ts"; | |
import { encode, decode } from "https://deno.land/[email protected]/encoding/hex.ts"; | |
class SecretStore { | |
#aes: AES; | |
constructor(data: { key: string; iv?: string }) { | |
this.#aes = new AES(data.key, { | |
mode: "cbc", | |
iv: data.iv ?? "random 16byte iv", |
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
function add(a: number, b: number): Promise<number> { | |
return Promise.resolve(a + b); | |
} | |
{ | |
const safeAdd = goify(add); | |
const [val /* 7 */, err /* null */] = await safeAdd(2, 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
A: How are you? | |
B: Good. How is your day going? | |
A: Tentatively good! I'm doing a bit of homework that's due tomorrow but it doesn't mean much! I've got some more projects to finish today though so that's good | |
B: What's your most favourite thing you've done for a project? | |
A: I really liked writing for a bit. Writing for a company I've worked for was a bit tough. | |
B: I like writing too! What did you write? | |
A: A story that I was working on at the time I wrote this one. I've also been writing a lot lately, actually. |
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
/** | |
* A logarithmic string length algorithm in the TypeScript type system utilizing | |
* a memoizing recursive type. Computes the length of any string with far | |
* superior performance than any other current implementations via a doubling | |
* cache and string patterns backing the checks. Works for any string with less | |
* than 10,000 characters due to the tuple size limits for the cache (in total). | |
* | |
* @author Carter Snook <[email protected]> github.com/sno2 | |
* @license https://unlicense.org/ (credit would be nice tho) | |
*/ |