Skip to content

Instantly share code, notes, and snippets.

Gmail Filters

Catch newsletters and junk

Matches: ("opt-out" OR unsubscribe OR "viewing the newsletter" OR "privacy policy" OR enews OR "edit your preferences" OR "email notifications" OR "update profile" OR smartunsubscribe OR secureunsubscribe OR yahoogroups OR "manage your account" OR "group-digests") Do this: Skip Inbox, Apply label "Work/Newsletters"

Keep pesky calendar invites out of inbox

Matches: (subject:("invitation" OR "accepted" OR "rejected" OR "updated" OR "canceled event" OR "declined") when where calendar who organizer) Do this: Skip Inbox, Apply label "GTD/Follow up"

Keep 90% of Sales emails out of Inbox

@jframos
jframos / mic_mute_script.workflow
Created December 22, 2017 09:25
AppleScript - Microphone mute
if input volume of (get volume settings) = 0 then
set level to 90
display notification "On" with title "Mic"
tell application "System Events"
tell appearance preferences
set dark mode to false
end tell
end tell
else
set level to 0
@gurre
gurre / attiny85-on-sierra.md
Last active June 7, 2023 12:28
How to program the ATTiny85 on MacOS Sierra

How to program the ATTiny85 on MacOS Sierra

Check MacOS version

$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.11.6
BuildVersion:	15G1611
@zaus
zaus / bkmklt-replace-in-selected-text.js
Last active August 4, 2022 11:20
Bookmarklet - Replace in Selected Text
(function() {
function getSelectionText() {
// https://stackoverflow.com/questions/5379120/get-the-highlighted-selected-text
var text = "";
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type != "Control") {
text = document.selection.createRange().text;
}
return text;
@jnv
jnv / check-urls.sh
Created November 8, 2016 21:08
Bulk check list of URLs with curl; outputs semicolon separated csv
#!/bin/bash
# Usage: check-urls.sh <urls list>
# <urls list> is a text file with 1 URL per line
echo "url;http_code;url_effective;error"
while read -r LINE; do
echo -n "$LINE;"
curl -o /dev/null -sS --max-time 5 --write-out '%{http_code};%{redirect_url};' "$LINE" 2> >(sed -e 's/$/;/' | tr -d '\n' | tr -d '\r')
sync
echo ""
done < "$1"
@idleberg
idleberg / sublime-text-macos-context-menu.md
Last active February 20, 2024 09:37 — forked from vincentmac/sublime-text-osx-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
@Dammmien
Dammmien / wget.sh
Last active March 13, 2024 13:58
wget cheat sheet
# POST a JSON file and redirect output to stdout
wget -q -O - --header="Content-Type:application/json" --post-file=foo.json http://127.0.0.1
# Download a complete website
wget -m -r -linf -k -p -q -E -e robots=off http://127.0.0.1
# But it may be sufficient
wget -mpk http://127.0.0.1
# Download all images of a website
@jonschlinkert
jonschlinkert / open-iterm-from-finder.md
Last active May 24, 2022 01:33
Add an icon to your finder toolbar to open iTerm in the current folder.

Open iTerm from finder

The code and instructions in this gist are from http://peterdowns.com/posts/open-iterm-finder-service.html. I've had to do this a few times and wanted to distill it the basics.

  1. Open Automator
  2. Create an Application
  3. Choose Actions > Utilities > Run Applescript
  4. Paste the contents of open_in_iterm.app into the window.
  5. Save the script somewhere convenient
  6. Find the script, then drag the script onto the Finder window while holding the command key (or in Yosemite, the command + option keys)
@olih
olih / jq-cheetsheet.md
Last active May 3, 2024 17:42
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@n-st
n-st / view-on-archive-org.js
Created February 28, 2016 16:20
Bookmarklet to view current page on the Internet Archive Wayback Machine (https://archive.org/)
javascript:(function(){if(location.href.indexOf('http')!=0){input=prompt('URL:','http://');if(input!=null){location.href='http://web.archive.org/web/*/'+input}}else{location.href='http://web.archive.org/web/*/'+location.href;}})();