Skip to content

Instantly share code, notes, and snippets.

View atnbueno's full-sized avatar
👨‍💻
🏴󠁵󠁳󠁣󠁡󠁿 Girona, Spain ⌚UTC+2

Antonio Bueno atnbueno

👨‍💻
🏴󠁵󠁳󠁣󠁡󠁿 Girona, Spain ⌚UTC+2
View GitHub Profile
@sindresorhus
sindresorhus / actions.md
Created November 26, 2024 21:10
Shortcuts actions provided by the Actions app. Can be useful to feed into an AI. https://sindresorhus.com/actions

Add to List

Adds the input item to the given list.

Even though the description says this action accepts input of type Files, it accepts any type.

Note: If you get the error “The operation failed because Shortcuts couldn't convert from Text to NSString.”, just change the preview to show a list view instead. This is a bug in the Shortcuts app.

Parameters

@rcarmo
rcarmo / automator.py
Last active March 28, 2025 02:39
macOS Services in the style of NotesOllama
# Drop this into Automator using Python 3 as the shell
from sys import stdin
from json import dumps, loads
from urllib.parse import urlencode
from urllib.request import Request, urlopen
AZURE_ENDPOINT="getyourowndeployment.openai.azure.com"
OPENAI_API_KEY="getyourownkey"
OPENAI_API_VERSION="2023-05-15"
@kconner
kconner / macOS Internals.md
Last active May 6, 2025 05:33
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@drewkerr
drewkerr / set-focus-mode.js
Created April 13, 2022 14:51
Set a Focus mode on macOS Monterey (12.0+) using JavaScript for Automation (JXA)
function toggleFocus(focus) {
const app = Application("System Preferences")
const pane = app.panes.byId("com.apple.preference.notifications").anchors.byName("Focus")
app.reveal(pane) // Open the preference pane
// Useful way of inspecting the UI hierarchy of an open app:
// Application("System Events").applicationProcesses.byName("System Preferences").entireContents()
const ui = Application("System Events").applicationProcesses.byName("System Preferences").windows.byName("Notifications & Focus").tabGroups.at(0)
@drewkerr
drewkerr / get-focus-mode.js
Last active April 4, 2025 04:29
Read the current Focus mode on macOS Monterey (12.0+) using JavaScript for Automation (JXA)
const app = Application.currentApplication()
app.includeStandardAdditions = true
function getJSON(path) {
const fullPath = path.replace(/^~/, app.pathTo('home folder'))
const contents = app.read(fullPath)
return JSON.parse(contents)
}
function run() {
@dcatanzaro
dcatanzaro / widget-html-css-scriptable-jobs.js
Last active September 1, 2024 22:06
Widget con HTML y CSS en Scriptable
//Twitter: https://twitter.com/DamianCatanzaro
const html = "<html> \
<head> \
<style> \
body { \
margin: 0; \
background-color: cyan; \
width: 500px; \
height: 500px; \
@atoponce
atoponce / rates.md
Last active April 25, 2025 02:20
Verifiable brute force strength rates across different projects

Verifiable brute force strength

Below are table of various projects that can completely exhaust n-bits of keyspace. In other words, counting completely and fully from 0 to 2ⁿ-1.

This Gist implies no discussion about how this is relevant to quantum computing using Grover's algorithm, meet-in-the-middle or birthday attacks, or anything of the like. It's strictly a Gist about raw speed, measuring the result in bits.

If you know of other noteworthy and verifiable brute force searching projects,

@andrewplus
andrewplus / iphone-png-images-normalizer.py
Last active July 8, 2021 14:47
Based off a program by Axel E. Brzostowski. https://axelbrz.com/?mod=iphone-png-images-normalizer Makes the script work properly in Python 3+. Tested with 3.7.
#---
# iPIN - iPhone PNG Images Normalizer v1.0
# Copyright (C) 2007
#
# Author:
# Axel E. Brzostowski
# http://axelbrz.com/
# [email protected]
#
# Python 3+ compatibility added by andrew.plus. Tested with 3.7
@eltabo
eltabo / DigitoControl.java
Created January 14, 2016 07:46
Cálculo del dígito de control del código de municipio INE
public class DigitoControl {
private static final int[][] magic = {
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9},
{0, 3, 8, 2, 7, 4, 1, 5, 9, 6},
{0, 2, 4, 6, 8, 1, 3, 5, 7, 9}
};
public static int calc(int test) {
byte[] bytes = String.format("%05d", test).getBytes();
@JMichaelTX
JMichaelTX / JXA Resources.md
Last active April 15, 2025 04:32
JavaScript for Automation (JXA) Resources

JXA Resources

Revised: 2019-11-28 16:16 GMT-6

JXA

This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.

I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.