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 contextlib import contextmanager | |
# Helper methods | |
def pprint_dict(d): | |
return '[' + ', '.join([f'{k} = {d[k]}' for k in d]) + ']' | |
def composable_tree(): |
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
## Singly Linked List | |
- new node | |
- size | |
- insert at beginning | |
- insert at end | |
- insert at position | |
- delete at beginning | |
- delete at end | |
- delete at position | |
- print list |
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
fn loading() { | |
colors := [41, 42, 43, 44, 45, 46] | |
cursor_left := '\e[1000D' | |
reset := '\e[0m' | |
pbar := ' ' | |
scale := 2 | |
for i in 0..100+1 { | |
time.sleep_ms(50) | |
width := (i+1) / scale | |
mut bar := '' |
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
file = open("lorem.txt", "r") | |
text = file.read() | |
v = 0 | |
c = 0 | |
u = 0 | |
l = 0 | |
for char in text: |
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
class TimeFormatted extends HTMLElement { | |
render() { // (1) | |
alert(1) | |
} | |
connectedCallback() { // (2) | |
if (!this.rendered) { | |
this.render(); |
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
body { background-color: black; } | |
.mat-card { filter: invert(0.9); } | |
#svgChart > g:nth-child(2) > rect:nth-child(1) { fill: black; } | |
#courseName { color: white; } | |
.selector { filter: invert(1); position: absolute; top: 83px; left: 30%; } | |
.top a { visibility: hidden; } | |
.question { background-color: black; max-height: none !important; padding: 0 !important; overflow: unset !important; } | |
.solution { width: 68% !important; } | |
.question a { font-family: "Cascadia Mono"; } | |
.question pre, .solution pre.ng-star-inserted { padding: 4px; background-color: black; } |
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
// Sets the bit at pos to 1 if 0, else keeps unchanges | |
void set_bit(int *bits, int pos) { | |
(*bits) |= (1 << pos); | |
} | |
// Clears the bit at pos to 0 if 1, else keeps unchanged | |
void clear_bit(int *bits, int pos) { | |
(*bits) &= ~(1 << pos); | |
} |
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
Invoke-RestMethod https://dl.google.com/android/studio/metadata/distributions.json | Format-Table name, @{ Label = 'version'; Expression = { $_.version }; Align = 'right' }, apiLevel, @{ Label = 'distribution'; Expression = { "$([math]::Round($_.distributionPercentage * 100, 1))%" }; Align = 'right' } |
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
#include <stdio.h> | |
#include <string.h> | |
#include <time.h> | |
struct Book { | |
int BookNumber; | |
char BookTitle[100]; | |
char Author[100]; | |
char Publisher[100]; | |
int YearOfPublication; |
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
@UsesPermissions({ | |
$LList$ | |
}) |