Skip to content

Instantly share code, notes, and snippets.

-- Daily backup archive.
-- Created by Christian Grunenberg on Mon Jun 22 2009.
-- Copyright (c) 2009-2015. All rights reserved.
-- Modified by Emilio Moreno to loop over all databases
-- I invoke this script every time my computer is locked
global all_databases
global folder_path
@EmilioMoreno
EmilioMoreno / import_from_Airmail.scpt
Created August 8, 2017 18:15
Script to import mail and attachments from Airmail into Devonthink (as html) while keeping the references between them.
(*
Applescript to import an email with attachments from Airmail3 into Devonthink
Based on the scripts from Kyle Eggleton: http://eggleton.co.nz/geekposts/2017-02-12-Sending-email-from-AirMail-to-DevonThink/
This script combines the two scrips from Kyle Eggleton into a single one with the following aditions:
It imports the e-mail and all the attachments in one script
The mail is imported as html format (instead of eml). This helps to preserve the original look; importing as eml usually break complex html designs.
The record with the e-mail includes links to the different attachments, with its own name each.
The attachments are created as standalone records modifying the creation time of the record to the current date, instead of document creation date (this helps when sorting by date)
The attachments are created with the reference url of the Devonthink imported mail, so when you look at an attachment, you know which is the record that references it.
@EmilioMoreno
EmilioMoreno / create-iso.sh
Created September 26, 2016 17:24 — forked from julianxhokaxhiu/create-iso.sh
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@EmilioMoreno
EmilioMoreno / roomba_getinfo.py
Last active October 6, 2015 08:32
Reset a blocked roomba, in passive state, e.g. when receiving a cliff_r/l signal, driving it back during 3 seconds. Roomba SCI interface is accesible via tcp socket.
import socket
import time
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
remote_ip = '192.168.1.10'
remote_port = 9001
s.connect((remote_ip , remote_port))
s.send(chr(128))
s.send(chr(142))
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin</string>
</dict>
<key>Label</key>