You are a teacher of algorithms and data-structures who specializes in the use of the socratic method of teaching concepts. You build up a foundation of understanding with your student as they advance using first principles thinking. Explain the subject that the student provides to you using this approach. By default, do not explain using source code nor artifacts until the student asks for you to do so. Furthermore, do not use analysis tools. Instead, explain concepts in natural language. You are to assume the role of teacher where the teacher asks a leading question to the student. The student thinks and responds. Engage misunderstanding until the student has sufficiently demonstrated that they've corrected their thinking. Continue until the core material of a subject is completely covered. I would benefit most from an explanation style in which you frequently pause to confirm, via asking me test questions, that I've understood your explanations so far. Particularly helpful are test questions related to sim
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """ | |
| To make a video display in a web page so it adapts to the user, | |
| you want to do two things: | |
| 1. serve the video at a size that matches the user's screen and | |
| device. This is the job of responsive video, and is described by | |
| https://scottjehl.com/posts/using-responsive-video/ very well |
This file contains hidden or 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
| // Update 2025-05-22 — ported to rand v0.9, using a struct with Display impl rather than returning a string | |
| struct MarineLine; | |
| impl std::fmt::Display for MarineLine { | |
| fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | |
| use rand::{Rng, seq::IndexedRandom}; | |
| let marine_life = ["🐳", "🐠", "🦈", "🐙", "🐡", "🐬", "🐟", "🦀", "🐋"]; | |
| let water = [ |
This file contains hidden or 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 { parse } from "https://deno.land/x/[email protected]/mod.ts"; | |
| var file = Deno.args[0]; | |
| var input = await Deno.readTextFile(file); | |
| var parsed = parse(input, { value: true }); | |
| var root = { | |
| rules: [], |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| # SPDX-License-Identifier: 0BSD or CC0-1.0 or MIT-0 or Unlicense | |
| # Copyright (c) 2023, Ryan Castellucci, No Rights Reserved | |
| import io, sys | |
| import datetime | |
| import argparse | |
| import requests | |
| import operator | |
| import struct |
This file contains hidden or 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 killport { | |
| echo '🚨 Killing all processes at port' $1 | |
| lsof -ti tcp:$1 | xargs kill | |
| } |
This file contains hidden or 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
| # Taken from https://www.reddit.com/r/MacOS/comments/i4czgu/big_sur_airpods_script/gck3gz3/ | |
| # by https://github.com/smithumble | |
| use framework "IOBluetooth" | |
| use scripting additions | |
| set AirPodsName to "AirPods" | |
| on getFirstMatchingDevice(deviceName) | |
| repeat with device in (current application's IOBluetoothDevice's pairedDevices() as list) |
This file contains hidden or 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
| #!/bin/bash | |
| # http://redsymbol.net/articles/unofficial-bash-strict-mode/ | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| # inspired by | |
| # https://gist.github.com/codeinthehole/26b37efa67041e1307db | |
| # https://github.com/why-jay/osx-init/blob/master/install.sh | |
| # https://github.com/timsutton/osx-vm-templates/blob/master/scripts/xcode-cli-tools.sh |
This file contains hidden or 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
| # v20201127 | |
| # | |
| # If you edit the files, you have to run "smtpctl update table <aliases|secrets>" | |
| table aliases file:/etc/aliases | |
| table secrets file:/etc/secrets | |
| # To accept external mail, replace with: listen on all | |
| # | |
| listen on localhost |
This file contains hidden or 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
| Mute these words in your settings here: https://twitter.com/settings/muted_keywords | |
| ActivityTweet | |
| generic_activity_highlights | |
| generic_activity_momentsbreaking | |
| RankedOrganicTweet | |
| suggest_activity | |
| suggest_activity_feed | |
| suggest_activity_highlights | |
| suggest_activity_tweet |
NewerOlder