Skip to content

Instantly share code, notes, and snippets.

View coffeepostal's full-sized avatar

Adam Farnsworth coffeepostal

View GitHub Profile
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@DJNgoma
DJNgoma / RoundingToNearest5Cent.swift
Last active January 4, 2018 03:08
Rounding to the nearest 5 cents in Swift or C
// Basic C, but being used in a Swift project of mine.
// Just a simple way of getting any floating number to round up or down to a 5 cent figure for calulations.
let x = 45.23
let y = 23.58
let z = 82.12
a = round(x/0.05)*0.05
b = round(y/0.05)*0.05
c = round(z/0.05)*0.05
@xunker
xunker / delete_all_from_sender.scpt
Last active December 8, 2023 22:46
Delete all from sender - an Applescript for the Mail.app in Mac OS X that will search for all messages set by the sender of the email message currently open and allow you to delete them all at once.
-- Delete all from sender - https://gist.github.com/xunker/44fa4404c882c27e0ad25857e9470552
-- For the Mail.app in Mac OS X. It will search for all messages set by the sender of the email message currently open,
-- highlight them all and ask if you want to delete them. If you choose "yes" it will delete them for you and then clear
-- the search.
--
-- Important notes:
-- You can load this in Script Editor and then save it as an application so you can run it without Script Editor being open.
-- This does not work when Mail.app is in fullscreen mode; it must be in windowed mode.
-- You will need to enable "Assistive Devices" support for Script Editor (if run there) or for the .app you saved if you converted it to a standalone app.