Skip to content

Instantly share code, notes, and snippets.

@atika
atika / network_drive.list
Created March 26, 2017 15:50
Generate macOS apps from a list to mount your networks volumes
Awesome Volume;afp://macbookpro.local/MyHD
Home on MacBookPro;afp://macbookpro.local/macuser
DiskStation Video;smb://192.168.0.20/video
DiskStation Music;smb://192.168.0.20/music
@atika
atika / SecondsToDaysHoursMinutesSeconds.swift
Created March 10, 2016 09:55
Convert seconds to days, hours, minutes, seconds in Swift
let seconds = 86400*4 + 3600*2 + 65
print(String((seconds / 86400)) + " days")
print(String((seconds % 86400) / 3600) + " hours")
print(String((seconds % 3600) / 60) + " minutes")
print(String((seconds % 3600) % 60) + " seconds")
@atika
atika / LaunchBar-Theme-Arguments.txt
Last active July 6, 2023 08:40
A non exhaustive list of LaunchBar theme arguments, extracted with grep from bundled themes, to make your custom themes.
defaultBoldFontName
defaultDimmedTextColor
defaultEmphasizedFontName
defaultFontName
defaultSelectedTextShadowColor@1x
defaultSelectedTextShadowColor@2x
defaultShadowOffset
defaultTextColor
defaultTextShadowColor
defaultTextShadowColor@2x
@atika
atika / README.md
Last active September 25, 2023 19:01
Text field and options dropdown for espanso (macOS only)

Simple prompt for espanso https://espanso.org/ on macOS

For the time being, espanso does not come with a graphical user interface, in the meanwhile you can use this workaround to prompt for text or select result in a list, on macOS.

Create a folder scripts in the espanso preferences folder and copy these files: /Users/<username>/Preferences/espanso/scripts/.

You can also copy Pashua app app into this folder.

espanso popup demo

@atika
atika / pushover
Last active October 20, 2023 19:37
Send a pushover notification from Bash
#!/bin/bash
# ./pushover.sh -t "Pushover via Bash" -m "Pushover message sent with bash from $(hostname -f)" -p1 -s siren -u http://www.google.com -n "Google"
USER_TOKEN=YOUR_USER_TOKEN_HERE
# YOUR APPS TOKENS / UPPERCASE NAME WITH _TOKEN (usage: "-a monitor" uses MONITOR_TOKEN)
MONITOR_TOKEN=APP_TOKEN
BACKUP_TOKEN=APP_TOKEN
ALERT_TOKEN=APP_TOKEN
APP_LIST="monitor, backup, alert" # FOR USAGE
@atika
atika / iphone-simulator-app-folder.sh
Last active November 13, 2023 14:05
Open the iOS Simulator folder containing -user defaults- plists files for your Application
#!/bin/bash
appname="$1"
[ -z $appname ] && read -p "Application name : " appname
apppath=$(find ~/Library/Developer/CoreSimulator/Devices/ -name "$appname.app" -print -quit)
if [[ ! -z $apppath ]]; then
echo "Found path for $appname app"
echo -e "\033[1;30m$apppath\033[0m"
appbundle=$(osascript -e "id of app \"$apppath\"")