Skip to content

Instantly share code, notes, and snippets.

var depth = parseInt(prompt("Please enter the scraping depth (we recommend between 1 to 3):", "2"));
if(!Number.isInteger(depth) || depth < 1) {
alert("Invalid depth! Setting depth to default (2).");
depth = 2;
}
var count = 1;
async function start() {
@mildsunrise
mildsunrise / install-ubuntu-by-netboot.md
Last active March 1, 2024 22:55
Boot an Ubuntu ISO through network (with EFI)

Netboot Ubuntu with EFI

This method is not netinst. The ISO is downloaded from a URL into RAM, and mounted. After that, installation proceeds exactly as if it was a pen drive / CDROM, and the network cable can be disconnected if you want.

You do not need internet in either computer, just the ISO file.

We don't touch any system files, just delete $TFTPROOT and dnsmasq.conf when you're done.

Before you begin

@mildsunrise
mildsunrise / flatten.py
Last active September 17, 2021 12:39
Git history flattener https://twitter.com/mild_sunrise/status/1300181598306996224 (needs GitPython)
#!/usr/bin/env python3
from git import Repo, Commit
list_commits = lambda commits: '\n'.join(' {} {}'.format(n.hexsha[:8], n.message.splitlines()[0]) for n in commits)
repo = Repo.init('path to bare clone', bare=True, mkdir=False)
refs = repo.refs
# load whole graph
def visit_graph(roots, get_parents=lambda n: n.parents):
queue = list(roots)
@SteveSandersonMS
SteveSandersonMS / blazor-auth.md
Created June 11, 2019 10:49
Blazor authentication and authorization

Authentication and Authorization

Authentication means determining who a particular user is. Authorization means applying rules about what they can do. Blazor contains features for handling both aspects of this.

It worth remembering how the overall goals differ between server-side Blazor and client-side Blazor:

  • Server-side Blazor applications run on the server. As such, correctly-implemented authorization checks are both how you determine which UI options to show (e.g., which menu entries are available to a certain user) and where you actually enforce access rules.
  • Client-side Blazor applications run on the client. As such, authorization is only used as a way of determining what UI options to show (e.g., which menu entries). The actual enforcement of authorization rules must be implemented on whatever backend server your application operates on, since any client-side checks can be modified or bypassed.

Authentication-enabled templates for Server-Side Blazor

@alyssa
alyssa / sonic_pi_feeling_blue.rb
Last active July 9, 2022 15:58
Standard 12 bar blues (bass line + comping) for sonic pi (sonic-pi.net)
# Standard 12 bar blues
# I7 | IV7 | I7 | I7
# IV7 | IV7 | I7 | I7
# V7 | IV7 | I7 | I7
# Choose a root note (one) and everything else will fall into place.
one = :G2
four = one + 5
five = one + 7