Skip to content

Instantly share code, notes, and snippets.

View LawrenceHwang's full-sized avatar
☁️

Lawrence Hwang LawrenceHwang

☁️
View GitHub Profile
@LawrenceHwang
LawrenceHwang / deep-focus.js
Created September 28, 2026 19:07
Strudel experiment
// ═══════════════════════════════════════════════════════════════════════
// "DEEP FOCUS / 28" – a 28-minute progressive / French-house Pomodoro set
// 128 BPM · 896 bars · original composition · built-in Strudel sounds only
// Paste into https://strudel.cc and press Ctrl+Enter (Cmd+Enter on macOS).
// ═══════════════════════════════════════════════════════════════════════
// ── USER CONTROLS ──────────────────────────────────────────────────────
const MASTER = 0.8 // master volume, 0 … 1
const BRIGHT = 1.0 // brightness: 0.6 = darker/softer … 1.0 = normal … 1.4 = brighter
const START_BAR = 0 // preview from bar: 0 intro · 64 groove · 192 funk · 352 acid ·
@LawrenceHwang
LawrenceHwang / Instagram Saved Posts Bulk Unsaver.js
Created September 15, 2026 00:08
Instagram Saved Posts Bulk Unsaver.js
// ==UserScript==
// @name Instagram Saved Posts Bulk Unsaver
// @namespace instagram-unsaver.local
// @version 1.4.0
// @description Adds a button on your Instagram "Saved > All posts" page that automatically unsaves every saved post.
// @match https://www.instagram.com/*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_addStyle
// @run-at document-idle
@LawrenceHwang
LawrenceHwang / instagram-quick-actions.js
Last active September 26, 2026 21:39
instagram-quick-actions
// ==UserScript==
// @name Instagram Quick Actions
// @namespace https://www.instagram.com/
// @version 0.6.3
// @description Adds "Not Interested" and "Block Account" shortcut buttons to every Instagram feed post.
// @match https://www.instagram.com/*
// @run-at document-idle
// @grant none
// ==/UserScript==
@LawrenceHwang
LawrenceHwang / URL-Clean.js
Last active September 14, 2026 05:02
UserScript to clean up tracking, unwanted parameters. To be used with extension such as TamperMonkey
// ==UserScript==
// @name URL Clean
// @namespace https://github.com/
// @version 0.1.9
// @description Cleans safe tracking parameters and known redirect wrappers on an allowlisted set of video, shopping, search, and social sites.
// @match https://*.youtube.com/*
// @match https://youtu.be/*
// @match https://*.twitter.com/*
// @match https://x.com/*
// @match https://*.facebook.com/*
@LawrenceHwang
LawrenceHwang / byok-demo.py
Created May 8, 2026 03:51
GitHub Copilot SDK BYOK Demo
"""
BYOK (Bring Your Own Key) demo for the GitHub Copilot SDK.
Sends a single prompt to any OpenAI-compatible endpoint — local Ollama, OpenAI,
Azure OpenAI, or any other compatible API — using the Copilot SDK session API.
Usage
-----
# Local Ollama (default, no key required)
uv run byok.py --prompt "Tell me a joke"
@LawrenceHwang
LawrenceHwang / GitHub Copilot Customization Architecture.md
Created February 17, 2026 07:57
GitHub Copilot Customization Architecture
@LawrenceHwang
LawrenceHwang / Set-MonitorInputSource.ps1
Created February 18, 2022 20:50
Set-MonitorInputSource - wraps around the ControlMyMonitor.exe
function Set-MonitorInputSource {
<#
.SYNOPSIS
Helper function to set the monitor state.
.EXAMPLE Switch to HDMI
Set-MonitorInputSource -InputSource HDMI
.EXAMPLE Switch to DisplayPort
Set-MonitorInputSource -InputSource DisplayPort
@LawrenceHwang
LawrenceHwang / Convert-FromApplePrivacyReport.ps1
Created October 16, 2021 03:25
Helper function to convert the iOS app activity report into custom objects
function Convert-FromAppActivityReport {
<#
.SYNOPSIS
Helper function to convert the iOS app activity report into custom objects
https://developer.apple.com/documentation/foundation/urlrequest/inspecting_app_activity_data
.EXAMPLE
Get apps accessed iOS resources
Convert-FromAppActivityReport -Path $path -Type access | Select-Object accessor_id -Unique
@LawrenceHwang
LawrenceHwang / Set-TaskbarFontSize.ps1
Created October 14, 2021 04:57
Helper function to set the taskbar icon size
function Set-TaskbarIconSize {
# Sets the windows 11 task bar icon size. Default value is medium.
[CmdletBinding()]
param(
[validateset("small", "medium", "large")]
[string]$Size = "medium"
)
$sizeChart = @{
"small" = 0
"medium" = 1
@LawrenceHwang
LawrenceHwang / Pre-Meeting-Check.ps1
Created July 15, 2020 17:59
Pre-meeting system health check using PowerShell's Pester 5.
Describe 'Pre-meeting Check List' { # These are a Pester 5 compliant tests.
Context 'Device Check' {
It 'Device should be present and have OK status: [<deviceName>]' -TestCases @(
@{deviceName = 'Blue Snowball' }
@{deviceName = '*TrackBall Mouse' }
@{deviceName = 'Microphone (Blue Snowball)' }
@{deviceName = 'Canon EOS 6D Mark II' }
) {
$device = (Get-PnpDevice -FriendlyName $deviceName -Status 'OK' -PresentOnly -ErrorAction SilentlyContinue)
$device.count | Should -BeGreaterOrEqual 1