Skip to content

Instantly share code, notes, and snippets.

@gruber
gruber / gist:1063605
Created July 4, 2011 16:48
Simple Inbox Archiving Script for Apple Mail
-- See article here: http://daringfireball.net/2007/07/simple_inbox_sweeper
-- The following should be one long line:
set _description to "All unflagged, read messages in each IMAP account
inbox will be moved to the “Archive” mailbox corresponding to that
account. This action is not undoable."
tell application "Mail"
display alert "Archive read messages from IMAP inboxes?" buttons ¬
{"Cancel", "Archive"} cancel button 1 message _description
@wibron
wibron / gist:1152143
Created August 17, 2011 17:52
Run shell-command with Applescript as root
-- The shellscript:
-- #!/bin/sh
-- sudo mount_nfs -P 192.168.0.1:sharename ~/localPath
tell application "Terminal"
do shell script "~/.shellscript.sh" password "yourpassword" with administrator privileges
quit
end tell
@henrik
henrik / ocr.markdown
Created March 3, 2012 17:07
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

@mrtazz
mrtazz / imap_check.py
Created September 18, 2012 04:06
quick script to check unread count of imap inbox
#!/usr/bin/env python
"""
small script to check for unread count on imap inbox
"""
import imaplib
IMAPSERVER = ''
USER = ''
PASSWORD = ''
@RadLikeWhoa
RadLikeWhoa / bookmarklets-history.md
Last active March 7, 2024 21:03
A history of the networks added to the bookmarklets list.

January 14, 2013

News

  • Google Reader
  • Instapaper
  • Pinboard
  • Pocket
  • Readability
  • Storify
@amberj
amberj / rgb-colored-echo.sh
Last active April 25, 2024 21:45
A bash pretty print script that provides following red/green/blue colored echo functions.
#!/bin/bash
#
## @file rgb-colored-echo.sh
## @author Amber Jain
## @section DESCRIPTION A bash pretty print script which provides red/green/blue colored echo functions
## @section LICENSE ISC
#################
# Documentation #
@noestreich
noestreich / DriveNow-Statusboard.php
Last active December 16, 2015 11:18
Snippet for Panic's iPad App "Statusboard" to show available Drive Now cars in Berlin within a predefined radius. i.e: How many free cars are within 300m from my home-address? Screenshot: http://i.imgur.com/zjvq1Ev.jpg
<?php
##config for homelocation and radius (in meter)
$myhomelat = "52.49993";
$myhomelng = "13.39190";
$myradius = "300";
## get the drive now json
$driveURL = "https://www.drive-now.com/php/metropolis/json.vehicle_filter?cit=6099";
$process = curl_init($driveURL);
curl_setopt($process, CURLOPT_HEADER, false);
@harperreed
harperreed / DownloadStationAPI.py
Last active January 4, 2022 08:13
example script to sync/download/etc put.io downloads to your synology download station
import time
import requests
import json
class DownloadStationAPI():
def __init__(self, host=None, username=None, password=None):
self.name = 'DownloadStation'
@pheraph
pheraph / backup-uberspace.sh
Last active January 24, 2017 19:21
Eine lokale Sicherung eines oder aller uberspace(s) erstellen
#!/bin/sh
#
# Erstellt eine lokale Sicherung von /home/username, /var/www/virtual/username und der Datenbanken des Benutzers
#
# Voraussetzungen:
# Auf dem lokalen Computer sind die uberspaces in ~/.ssh/config wie folgt konfiguriert:
# Host uberspacename
# HostName sternenkonstellation.uberspace.de
# User uberspacename
#
@empiricalthought
empiricalthought / CheckGitHubPR.scpt
Created December 14, 2013 21:48
This Applescript can be applied as a rule to incoming GitHub pull request notification e-mails. It will create a reminder in the OS X "Reminders" app if the assignee matches the account on the incoming mail.
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
set credentials to do shell script "security find-internet-password -g -s github.com 2>&1 | awk '
/^password:/ {
sub(\".*password: \\\"\", \"\")
sub(\"\\\".*\", \"\")
password = $0
}
/acct/ {