Skip to content

Instantly share code, notes, and snippets.

@isao
isao / moreFinderTerminal.sh
Created September 21, 2024 20:40 — forked from ldavidh/moreFinderTerminal.sh
alternate sel script
#cd into directory in Finder's front window
function cdf() {
finderPath=`osascript -e 'try
tell application "Finder" to set the source_folder to (folder of the front window) as alias
on error
tell application "Finder" to set source_folder to insertion location as alias
end try
return POSIX path of source_folder as string'`
cd "$finderPath"
@isao
isao / gist:c49910951638d15175fa6086fe841aea
Created April 12, 2024 00:03 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@isao
isao / Web Component for Copyright Years.md
Created March 29, 2024 17:58 — forked from ceving/Web Component for Copyright Years.md
Web Component for Copyright Years
@isao
isao / DOM3D.js
Created March 27, 2024 15:57 — forked from OrionReed/dom3d.js
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@isao
isao / list_launchd_notifications.sh
Created March 19, 2024 17:51 — forked from dreness/list_launchd_notifications.sh
LaunchEvents -> com.apple.notifyd.matching
find /System/Library/LaunchDaemons /System/Library/LaunchAgents -name "*.plist" \
| while read p ; do plutil -convert json -o - ${p} \
| jq -r ' .. | objects | with_entries(select(.key == "Notification")) | select(. != {}).Notification'
done | sort -u > ~/Desktop/all-launchd-notifications.txt

ZSH CheatSheet

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.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@isao
isao / BBEdit LSP with Volta.md
Created January 6, 2023 23:11
BBEdit LSP with Volta
@isao
isao / Extract_URL_from_webloc.md
Created September 30, 2022 16:05 — forked from ChristopherA/Extract_URL_from_webloc.md
Extract URL from Safari .webloc

Extract URL from Safari .webloc

bash one-liner

plutil -p example.webloc | sed -En 's/.*"(.*)"$/\1/p'

Convert all .webloc files in directory to .url files

webloc2url.sh - Converts .webloc (Mac) to .url (Windows) files.

@isao
isao / brew-bundle-brewfile-tips.md
Created September 24, 2022 23:18 — forked from ChristopherA/brew-bundle-brewfile-tips.md
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@isao
isao / github-proxy-client.js
Created March 11, 2022 19:24 — forked from DavidWells/github-proxy-client.js
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})