https://www.youtube.com/playlist?list=PLKK11Ligqitg9MOX3-0tFT1Rmh3uJp7kA
Discover gists
#!/usr/bin/env -S cargo +nightly -Zscript --quiet | |
--- | |
[package] | |
edition = "2021" | |
[dependencies] | |
eyre = "0.6.12" | |
home = "0.5.9" | |
--- |
license: gpl-3.0 | |
height: 600 | |
border: no | |
redirect: https://beta.observablehq.com/@mbostock/d3-choropleth |
{ | |
"language": "Solidity", | |
"sources": { | |
"contracts/Verified.sol": { | |
"content": "//SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.18;\r\n\r\ncontract Verified {\r\n string public greet =\r\n \"Increase this counter if you completed this tutorial\";\r\n string public tutorial =\r\n \"https://docs.etherscan.io/contract-verification/multichain-verification\";\r\n\r\n uint256 public verified = 0;\r\n\r\n function completedTutorial() public {\r\n verified += 1;\r\n }\r\n}\r\n" | |
} | |
}, | |
"settings": { | |
"metadata": { | |
"bytecodeHash": "none" |
WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".
Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:
If you purchase a textbook from McGraw Hill, the website to view it is clunky and only works on some devices. You can't go to specific page numbers, the search is super slow, etc. That's why I wrote this script to download the textbook as an ePub file for your own viewing.
Using this script is 100% legal. McGraw Hill publicly hosts their ebooks online in order for their web client to download it. Moreover, to use it, you must already have purchased the book you would like to download, so it is legally yours to use as you please. However, it IS illegal to use this for piracy purposes. DO NOT DISTRIBUTE ANY TEXTBOOKS YOU DOWNLOAD USING THIS SCRIPT.
module AngrySupport::BelongsToPolymorphic | |
def belongs_to_polymorphic(name, allowed_classes:, **options) | |
belongs_to name, polymorphic: true, **options | |
validates "#{name}_type", inclusion: { in: allowed_classes.map(&:name), allow_nil: !!options[:optional] } | |
define_singleton_method(:"#{name}_types") { allowed_classes } | |
define_singleton_method(:"with_#{name}") do |type| | |
type = case type |
#!/bin/bash | |
# Check if an argument was provided | |
if [ $# -eq 0 ]; then | |
echo "No file path provided." | |
exit 1 | |
fi | |
# Use the provided argument (file path) | |
file="$1" |