Skip to content

Instantly share code, notes, and snippets.

View vegerot's full-sized avatar
💭
Hey 👋

Max Coplan vegerot

💭
Hey 👋
View GitHub Profile
@vegerot
vegerot / blank-site.html
Last active November 28, 2023 02:48
blank site with CWV stuff
<script>
async function setupCWVthingy() {
let cwv = await import(
"https://unpkg.com/web-vitals@3/dist/web-vitals.attribution.js?module"
);
const COLOR_GOOD = "#0CCE6A";
const COLOR_NEEDS_IMPROVEMENT = "#FFA400";
const COLOR_POOR = "#FF4E42";
const RATING_COLORS = {
--- test-cwd-executable.t
+++ test-cwd-executable.t.err
@@ -19,3 +19,4 @@
This is the code under test - don't run the "watchman" in CWD.
$ hg up -q .^
$ hg status
+ ? oops
ERROR: test-cwd-executable.t output changed
----------------------------------------------------------------------
----------------------------------------------------------------------
Skipped 4 tests (getdb.sh missing. copy from getdb.sh.example and edit it):
test-checkserverbookmark.t
test-fb-ext-fbconduit.t
test-fb-ext-pushrebase-cannot-rebasepublic.t
test-fb-ext-pushrebase-set-dates.t
Skipped 3 tests (missing feature: Mononoke server available):
test-fb-ext-remotefilelog-getpackv2.t
test-fb-ext-remotefilelog-log.t
@vegerot
vegerot / playground.html
Last active November 5, 2022 05:50
JavaScript Playground
<html>
<body>
<code>
<script type="module" contenteditable>
console.log("hello, world!");
const script = document.querySelector("script");
script.addEventListener("input", function runScript(e) {
eval(e.target.innerHTML);
script.removeEventListener("input", runScript);
});
@vegerot
vegerot / zoom.ts
Last active October 1, 2022 03:40
Notify you when someone in a Zoom call says something
/*
Steps to use this:
1. Join a Zoom call from the web
2. Enable Live Transcription
3. Open the console (Cmd + Opt + J)
4. Paste this code into the console
*/
// In order to be able to paste this script multiple times in the console,
Surma, this is a really well-researched and well-presented video, and you definitely do mention my points below 👇 , but it wasn't until I listened to this Changelog podcast last week that I realized just how pervasive browser-oriented thinking goes into the Deno design. You made a great video 💯 🙂
Really enjoyed this. You mention this in the video, but something I didn't realize until last week is Deno's core philosophy of: "Stick to existing web standards", and how that impacts all the decisions they make.
So they chose that import syntax because that's how the web does it, they chose the security model of the Deno process to make it similar to the web*, etc.. The reason that Deno doesn't introduce more file formats or have specific config files is because that's how the web works**. The main exception to this is TypeScript, which Ryan Dahl has actually said is his biggest REGRET about Deno***!
* In the future, they plan on changing Deno to prompt the user for more permissions instead of crashing,
* In the future, they plan on changing Deno to prompt the user for more permissions instead of crashing, like how browsers do it. Source: https://github.com/thechangelog/transcripts/blob/master/podcast/the-changelog-443.md#:~:text=Ryan%20Dahl%3A%20Yeah%2C%20I%20should,you%20opt%20into%20additional%20privileges
** Sources: https://github.com/thechangelog/transcripts/blob/master/podcast/the-changelog-443.md#:~:text=Ryan%20Dahl%3A%20%5B00%3A32,you%20ever%20get%20started , https://github.com/thechangelog/transcripts/blob/master/podcast/the-changelog-443.md#:~:text=Adam%20Stacoviak%3A%20This,you%20say%20that%3F
*** Source: https://github.com/thechangelog/transcripts/blob/master/podcast/the-changelog-443.md#:~:text=Ryan%20Dahl%3A%20This,extension%20to%20JavaScript
I would highly recommend this podcast episode, as it's one of the only podcasts Ryan has ever done https://changelog.com/podcast/443
@vegerot
vegerot / times.js
Created January 16, 2020 02:45
How do ticks work
#!/usr/bin/env node
// @flow
var start = Date.now();
var timer = setTimeout(() => {
console.log('done');
console.log(Date.now() - start);
}, 1);
var timer2 = setTimeout(() => {
console.log(timer);
console.log(Date.now() - start);
@vegerot
vegerot / new.sh
Created December 8, 2019 21:30
Modified partition table
label: dos
label-id: 0x000efb19
device: /dev/sdc
unit: sectors
/dev/sdc1 : start= 2048, size= 4612096, type=e
/dev/sdc2 : start= 4614144, size= 188287232, type=5
/dev/sdc5 : start= 4620288, size= 65534, type=83
/dev/sdc6 : start= 4685824, size= 524286, type=c
/dev/sdc7 : start= 5210112, size= 24773700, type=83
@vegerot
vegerot / modified.sh
Created December 3, 2019 04:05
dangerous partition table
label: dos
label-id: 0x000efb19
device: /dev/sdc
unit: sectors
/dev/sdc1 : start= 2048, size= 4612096, type=e
/dev/sdc2 : start= 4615235, size= 63514560, type=5
/dev/sdc5 : start= 4620288, size= 65534, type=83
/dev/sdc6 : start= 4685824, size= 524286, type=c
/dev/sdc7 : start= 5210112, size= 24773700, type=83