Skip to content

Instantly share code, notes, and snippets.

set remindersOpen to application "Reminders" is running
set todoistToken to "<YOUR_TOKEN_HERE>"
set apiCall to "curl https://api.todoist.com/sync/v9/quick/add"
set listOfCommands to {}
tell application "Reminders"
@fr0l
fr0l / zshrc prompt with git branch
Created February 16, 2023 21:31
Adds fast Git branch to your Zsh prompt. This is a replacement for big-and-clumsy oh-my-zsh which is slow on some big repos.
# Add this to ~/.zshrc (instead of heavy and clumzy oh-my-zsh)
function git_branch_name()
{
branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
if [[ $branch == "" ]];
then
:
else
echo ' '$branch
@fr0l
fr0l / GraalVM gu fix
Created December 3, 2021 18:29
Fix Error: The GraalVM directory /Library/Java/JavaVirtualMachines/graalvm-ce-java17-21.3.0/Contents is invalid.
# When getting error while using gu updater
% gu --version
Error: The GraalVM directory /Library/Java/JavaVirtualMachines/graalvm-ce-java17-21.3.0/Contents is invalid.
1. ensure GRAALVM_HOME set properly — i.e. GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java17-21.3.0/Contents/Home
2. ensure PATH has ${GRAALVM_HOME}/lib/installer/bin and ${GRAALVM_HOME}/bin (the lib/installer/bin has to be first)
PATH="${GRAALVM_HOME}/lib/installer/bin:${GRAALVM_HOME}/bin:${PATH}"
@fr0l
fr0l / current_selected_installed_xcode.md
Created July 14, 2021 13:27 — forked from dive/current_selected_installed_xcode.md
How to get the current selected Xcode and list installed

How to get the current selected Xcode and list installed

Current Selected Xcode

xcode-select

This is the most common way to get the path to the selected instance:

xcrun xcode-select --print-path
~ % find ~/Library/Developer/CoreSimulator/Devices/BBC2F33A-EC5D-433F-8C06-8698E20303A3 -type f -name TCC.db -exec sqlite3 {} 'select * from access' \;
kTCCServiceMediaLibrary|com.zzz.dev|0|2|4|1||||UNUSED||0|1597755443
kTCCServicePhotosAdd|com.zzz.dev|0|2|4|1||||UNUSED||0|1597755447
kTCCServicePhotos|com.zzz.dev|0|2|2|2||||UNUSED||0|1597755549
@fr0l
fr0l / How I Do PlantUML.md
Created July 23, 2020 07:55 — forked from jerieljan/How I Do PlantUML.md
PlantUML with Style -- How I do PlantUML

I use PlantUML a lot. It's what I use for drawing all sorts of diagrams and it's handy because of its easy markup (once you get used to it) while making things easy to maintain as projects grow (thanks to version control)

This gist explains how I do my PlantUML workspace in a project.

  • The idea is to keep a globals directory for all diagrams to follow (like the "stylesheet" below) to keep things consistent.
  • I use a stylesheet.iuml file that keeps the use of colors consistent through use of basic FOREGROUND, BACKGROUND and ACCENT colors.
  • The style-presets.iuml file defines these colors so you can make "presets" or "themes" out of them.
  • As stated in the stylesheet.iuml, you'll need the Roboto Condensed and Inconsolata fonts for these to work properly.
  • You can choose to either run the PlantUML jar over your file/s, or use an IDE like VSCode with the PlantUML extension. Here's a preview of example-sequence.puml for example: https://imgur.com/Klk3w2F
@fr0l
fr0l / mac-setup-redis.md
Created June 18, 2020 01:34 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@fr0l
fr0l / Paste and Match Style macOS by default.txt
Last active May 14, 2020 22:56
"Paste and Match Style" by default on macOS
For those who could not get used to press 4 keys to paste without formatting
To make "CMD + V" paste by default without any formatting - i.e. "Paste and Match Style":
1. Go to "System Preferences" -> Keyboard
2. Select 'App Shortcuts' on the left
3. Tap "+" sign to add a new shortcut
4. in the dialog
- Use "All Applications"
- In the field "Menu Title:" type exact text "Paste and Match Style"
@fr0l
fr0l / FirebaseCoordinator.swift
Created April 16, 2020 14:02 — forked from steipete/FirebaseCoordinator.swift
If you're as confused as I am that there's an API for custom options, yet Google still requires a file named GoogleService-Info.plist in your app, here's some swizzling that fixes that for ya. All Swift :)
class FirebaseCoordinator {
static let shared = FirebaseCoordinator()
static let initialize: Void = {
/// We modify Google Firebase (and eventually Analytics) to load the mac-specific plist at runtime.
/// Google enforces that we have a file named "GoogleService-Info.plist" in the app resources.
/// This is unfortunate since we need two different files based on iOS and Mac version
/// One solution is a custom build step that copies in the correct file:
/// https://stackoverflow.com/questions/37615405/use-different-googleservice-info-plist-for-different-build-schemes
/// However, this is basically impossible since Catalyst doesn't set any custom build variables, so detection is extremely difficult.
/// We swizzle to modify the loading times.
@fr0l
fr0l / web-servers.md
Created April 14, 2020 13:49 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000