- Create repo on GitHub where you'll put your files.
- Use jsDeliver or statically to get your assets.
Here is repo I'm using:
https://github.com/jcubic/static
And links to files look like this:
Here is repo I'm using:
https://github.com/jcubic/static
And links to files look like this:
# Manual opt parsing example | |
# | |
# Features: | |
# - supports short and long flags (ie: -v|--verbose) | |
# - supports short and long key/value options (ie: -f <file> | --filename <file>) | |
# - supports short and long key/value options with equals assignment (ie: -f=<file> | --filename=<file>) | |
# - does NOT support short option chaining (ie: -vh) | |
# - everything after -- is positional even if it looks like an option (ie: -f) | |
# - once we hit an arg that isn't an option flag, everything after that is considered positional | |
function optparsing_demo() { |
getJsonValue() { | |
# $1: JSON string to process, $2: Desired JSON key | |
osascript -l 'JavaScript' -e "JSON.parse(\`$1\`).$2;" | |
} | |
# String sent by a rogue API endpoint | |
json='{}`);const app = Application.currentApplication(); app.includeStandardAdditions = true;app.displayAlert("👾🔥🙈");JSON.parse(`{}'; | |
fullName=$(getJsonValue "$json" name) |
First, make a new file with the following contents:
#!/usr/bin/env ruby
dirs = []
ARGF.each { |line| dirs.push(line) }
import Cocoa | |
import MediaPlayer | |
let bundle = CFBundleCreate(kCFAllocatorDefault, NSURL(fileURLWithPath: "/System/Library/PrivateFrameworks/MediaRemote.framework")) | |
let MRMediaRemoteRegisterForNowPlayingNotificationsPointer = CFBundleGetFunctionPointerForName( | |
bundle, "MRMediaRemoteRegisterForNowPlayingNotifications" as CFString | |
) | |
typealias MRMediaRemoteRegisterForNowPlayingNotificationsFunction = @convention(c) (DispatchQueue) -> Void | |
let MRMediaRemoteRegisterForNowPlayingNotifications = unsafeBitCast(MRMediaRemoteRegisterForNowPlayingNotificationsPointer, to: MRMediaRemoteRegisterForNowPlayingNotificationsFunction.self) |
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
Description | Syntax |
---|---|
Get the length of a string | ${#VARNAME} |
Get a single character | ${VARNAME[index]} |
Tutorial and tips for GitHub Actions workflows
{ | |
"token": "[token]", | |
"job": "notifySlack", | |
"ref": "refs/pull/4/merge", | |
"sha": "[shad]", | |
"repository": "colbyfayock/demo-github-actions", | |
"repository_owner": "colbyfayock", | |
"repositoryUrl": "git://github.com/colbyfayock/demo-github-actions.git", | |
"run_id": 120667610, | |
"run_number": "2", |
Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.
To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:
tell application "System Preferences"
set CurrentPane to the id of the current pane
set the clipboard to CurrentPane