Skip to content

Instantly share code, notes, and snippets.

@bramus
bramus / bookmarklet.md
Last active August 3, 2023 16:56
Mastodon User Page Bookmarklet
@mrdoob
mrdoob / WebAudio.js
Last active February 14, 2024 05:02
HTMLAudioElement polyfill using the WebAudio API with seamless loop support in Safari.
/**
* @author mrdoob / http://mrdoob.com/
*/
function WebAudio( context ) {
if ( context === undefined ) {
context = WebAudio.context;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UnifiedBar</key>
<dict>
<key>DisclosureRequired</key>
<string>ace440ac-b4f6-4b43-aade-02bba1589aef</string>
<key>Enabled</key>
<false/>
html {
scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
}
@jamesls
jamesls / alias
Last active January 15, 2023 21:52
AWS CLI v2 upgrade aliases.
[toplevel]
# Put this in ~/.aws/cli/alias
# and you'll have an "aws upgrade"
# and an "aws check-upgrade" command.
#
# Only works on macOS and installs using
# the .pkg installer.
#
upgrade = !f() {
curl -s "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "/tmp/AWSCLIV2.pkg"
# Script to download all the WWDC 2020 session videos in the highest 4K video and audio
# You may have to update ffmpeg before using this script. I needed version 4.3 or higher to successfully download the videos.
#
# If you want the lower bitrate audio, do a find/replace of "audio_english_192" with "audio_english_64"
# If you want lower bitrate or lower resolution video, do a find/replace of "hvc_2160p_16800" with any of the following:
# "hvc_2160p_11600"
# "hvc_1440p_8100"
# "hvc_1080p_5800"
# "hvc_1080p_4500"
# "hvc_720p_3400"
@pydanny
pydanny / Makefile.bash
Created June 20, 2020 18:10
Fixing OSX Upload Speed
ls:
ls -l /Library/Preferences/SystemConfiguration/
backup:
sudo mv /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist ~/projects/wifi-backup
sudo mv /Library/Preferences/SystemConfiguration/com.apple.network.eapolclient.configuration.plist ~/projects/wifi-backup
sudo mv /Library/Preferences/SystemConfiguration/com.apple.wifi.message-tracer.plist ~/projects/wifi-backup
sudo mv /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist ~/projects/wifi-backup
sudo mv /Library/Preferences/SystemConfiguration/preferences.plist ~/projects/wifi-backup
// Run any SwiftUI view as a Mac app.
import Cocoa
import SwiftUI
NSApplication.shared.run {
VStack {
Text("Hello, World")
.padding()
.background(Capsule().fill(Color.blue))
@Starmel
Starmel / commonprofile_frag.metal
Created May 4, 2020 19:17
SceneKit Shader fragment functions
////////////////////////////////////////////////
// CommonProfile Shader v2
#import <metal_stdlib>
using namespace metal;
#ifndef __SCNMetalDefines__
#define __SCNMetalDefines__