Skip to content

Instantly share code, notes, and snippets.

View mkazlauskas's full-sized avatar

Martynas mkazlauskas

View GitHub Profile
@mkazlauskas
mkazlauskas / zamok2-api.js
Last active January 29, 2018 17:01
API example
function scanOnce() {
// Make sure running in Zamok and this specific API is available
var autofill = window.Zamok && window.Zamok.API && window.Zamok.API.Autofill;
if (!autofill) return Promise.reject("Either not in Zamok or 'zamok-api-autofill' solution is not enabled");
// Enable and wait for a single scan. Returns parsed data.
return autofill.scan();
}
scanOnce()
.then(data => console.log('Card scan successful', data)) // Do something with parsed data object
#!/usr/bin/env bash
# Workaround to set mail as read using astroid
set -e
echo "[mailsync]: hack"
ls ~/Mail | while read x; do
notmuch tag +unread +reunread -- path:$x/INBOX/new/** and not tag:unread
notmuch tag -unread -reunread -- tag:reunread
done