To use this in Alfred create a new workflow and then create a new action Run Script
and specify osascript (Javascript)
and paste in the below script.
See global-microphone-muteunmute-shortcuts for more context.
To use this in Alfred create a new workflow and then create a new action Run Script
and specify osascript (Javascript)
and paste in the below script.
See global-microphone-muteunmute-shortcuts for more context.
To use this in Alfred create a new workflow and then create a new action Run NSAppleScript
and paste in the below script.
Note: If you want to run this on the CLI you can remove the on alfred_script(q)
and end alfred_script
and add #!/usr/bin/env osascript
as the first line to run it from the CLI.
See http://sanitarium.se/blog/2024/04/15/day-to-day-automation-using-alfred/#spotify-controller for more context.
There are a couple of different things going on in the pipeline to open the browser:
sed -E 's|([ ]+)|-|g'
-
These are scripts that I am using through Alfred and have been for years. A ready-made workflow can be downloaded here: https://cell.sanitarium.se/~ba/spotify-keyboard-shortcuts.alfredworkflow
// Tracebacker implements the methods required to satisfy stretchr/mock's Test() interface | |
// Usage: | |
// my := new(MockMy) | |
// my.Test(&Tracebacker(t) | |
type Tracebacker struct { | |
t *testing.T | |
} | |
func (t *Tracebacker) Logf(format string, args ...interface{}) { | |
t.t.Logf(format, args...) |
#!/bin/bash | |
: ${DRY_RUN:=true} | |
if [ $# -lt 2 ]; then | |
echo "Usage: git merge-train <first branch> <branch based on first branch> [... branches based on previous]" | |
exit 0 | |
fi | |
if [ "${DRY_RUN}" != 'false' ]; then |
#!/usr/bin/env python3 | |
import json | |
import sys | |
try: | |
from pygments import highlight, lexers, formatters | |
def json_formatter(line: str) -> str: | |
return highlight(line, lexers.JsonLexer(), formatters.TerminalFormatter()) |
SELECT mmsi_positions_archive.id AS mmsi_positions_archive_id, | |
mmsi_positions_archive.position_id AS mmsi_positions_archive_position_id, | |
mmsi_positions_archive.previous_id AS mmsi_positions_archive_previous_id, | |
mmsi_positions_archive.mmsi AS mmsi_positions_archive_mmsi, | |
mmsi_positions_archive.collection_type AS mmsi_positions_archive_collection_type, | |
mmsi_positions_archive.accuracy AS mmsi_positions_archive_accuracy, | |
mmsi_positions_archive.course AS mmsi_positions_archive_course, | |
mmsi_positions_archive.heading AS mmsi_positions_archive_heading, | |
mmsi_positions_archive.maneuver AS mmsi_positions_archive_maneuver, | |
mmsi_positions_archive.rate_of_turn AS mmsi_positions_archive_rate_of_turn, |
package com.example; | |
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.core.annotation.Order; | |
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | |
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | |
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurer; | |
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer; |
#!/usr/bin/env python | |
# Takes the path to a local file and formats it using GitHub's raw Markdown API, | |
# then converts the returned HTML to their table format. | |
from pathlib import Path | |
from sys import argv | |
import requests # $ pip install requests | |
defmodule PingPonger do | |
def loop do | |
receive do | |
{:pong, sender} -> | |
IO.puts("Pong!") | |
send(sender, {:ping, self}) | |
{:ping, sender} -> | |
IO.puts("Ping?") | |
send(sender, {:pong, self}) | |
:exit -> |