Skip to content

Instantly share code, notes, and snippets.

View cipharius's full-sized avatar

Valts Liepiņš cipharius

  • Latvia
  • 14:17 (UTC +03:00)
View GitHub Profile
# to be executed on the device itself
# note that ~/xochitl-data is a symlink to avoid long path
quickNotesLayersToWiki(){ cd xochitl-data; curl -d "?n=PIMVRdata.ReMarkableQuicknotes&text=$(grep name UUID/*json | sed 's/.*: "\(.*\)"/%0a* \1/' | tr '\n' ' ')&action=edit&post=1&author=reMarkable2Ttest&authpw=edit_pw_to_change" https://fabien.benetou.fr/PIMVRdata/ReMarkableQuicknotes; cd -; }
# note that you must replace UUID and edit_pw by the UUID of your quicknote document (you can use hashFromTitle() for that) and your PmWiki password respectively.
qrCodeLink () { qrencode http://`ip a | grep wlan0$ | sed "s/.* \(.*\)\/.*/\1/"`:3000/data/$1.pdf -o qr_ip.xpm -t XPM && convert qr_ip.xpm qr_ip.pdf && addPdfWithMetadata qr_ip.pdf; }
hashFromTitle () { cd ~/.local/share/remarkable/xochitl/ && grep -l -i $1 *metadata | sed 's/.metadata//'; }
addPdfWithMetadata(){
cp $1 ~/xochitl-data && echo "{'parent':'','type':'DocumentType','visibleName':'$1'}" | sed s/\'/\"/g > ~/xochitl-data/`echo $1 | sed "s/.pdf//"`.met
@legumbre
legumbre / love2d.el
Created November 18, 2014 21:01
launch love2d app from Emacs
(defvar love2d-program "~/dev/love.app/Contents/MacOS/love")
(defun love2d-launch-current ()
(interactive)
(let ((app-root (locate-dominating-file (buffer-file-name) "main.lua")))
(if app-root
(shell-command (format "%s %s &" love2d-program app-root))
(error "main.lua not found"))))