Skip to content

Instantly share code, notes, and snippets.

View martin12333's full-sized avatar

Martin Milan martin12333

View GitHub Profile
@martin12333
martin12333 / mynote.xml
Last active August 29, 2015 14:27 — forked from xiaoganghan/mynote.xml
Parsing Evernote export file (.enex) using Python
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export2.dtd">
<en-export export-date="20120727T073610Z" application="Evernote" version="Evernote Mac 3.0.5 (209942)">
<note><title>Vim Tips</title><content><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
yank for copy, delete for cut, put for parse
<div><br/></div>
<div>Move in context, not position</div>
<div>/ search forward</div>
@martin12333
martin12333 / lxd-wayland-gui.md
Created May 19, 2018 12:21 — forked from stueja/lxd-wayland-gui.md
GUI application via Wayland from Ubuntu LXD container on Arch Linux host
@martin12333
martin12333 / qubes-authentication.md
Created May 26, 2018 18:21 — forked from tildelowengrimm/qubes-authentication.md
Qubes OS authentication info
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

When I install software, I'd prefer to have a secure delivery mechanism. Qubes OS uses a relatively robust system. A master signing key is kept on a “dedicated, air-gapped "vault" machine”. This key certifies dedicated keys for each major release.

Sadly, I don't have a good way to verify the Qubes master signing key. Instead, I tried downloading the Qubes key packet from various different network endpoints, and over a bunch of different Tor circuits. I asked some friends to try the same thing. We all got the same results.

@martin12333
martin12333 / hack
Created March 19, 2019 17:16 — forked from Jermolene/hack
Word counting hack for TiddlyWiki 5.1.7
var tag="mytag";r="";$tw.wiki.each(function(t){if(t.hasTag(tag)){r=r+" "+(t.fields.text||"")}});r.trim().replace(/\s+/gi," ").split(" ").length
@martin12333
martin12333 / canvas2png.js
Created March 24, 2019 16:48 — forked from jberryman/canvas2png.js
A jQuery one-liner for converting all html5 canvas elements in the DOM to PNGs
$('canvas').each(function(i,e){ var img = e.toDataURL("image/png"); $(e).replaceWith( $('<img src="'+img+'"/>').attr({width: $(e).attr("width"), height: $(e).attr("height"), style: $(e).attr("style") }) ) });

Writing template strings in Markdown

With template strings coming to ES6, the backtick (`) means something in Markdown and in JavaScript. If you write this:

To display a message, write `alert(`hello world!`)`.

it'll render like this:

To display a message, write alert(hello world!).

@martin12333
martin12333 / life.py
Created May 26, 2020 11:41 — forked from teoliphant/life.py
Array-oriented version of the game of life
from numpy.random import rand
from numpy import r_, ix_, uint8, roll
import matplotlib.pyplot as plt
import time
size = 200
GRID = (rand(size,size) > 0.75).astype(uint8)
# Rotate indices because the world is round
indx = r_[0:size]
up = roll(indx, -1)
@martin12333
martin12333 / Eclipse.desktop
Created July 16, 2020 13:22
Eclipse launcher for Ubuntu 15.04 with Unity
[Desktop Entry]
Version=1.0
Name=Eclipse
Exec=env UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 SWT_GTK3=0 <path to eclipse>/eclipse
Icon=<path to eclipse>/eclipse/icon.xpm
Terminal=false
Type=Application
StartupNotify=true
@martin12333
martin12333 / import_bookmarks_to_evernote.py
Created January 28, 2021 18:22 — forked from richard-to/import_bookmarks_to_evernote.py
Quick and dirty script to import bookmarks into Evernote. Expected bookmarks file is in Delicious format. In my case, I needed to export Diigo bookmarks into Evernote.
from xml.sax.saxutils import escape
from datetime import datetime
from bs4 import BeautifulSoup
headerXml = """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd">
<en-export application="Evernote" version="Evernote Mac">"""
footerXml = "</en-export>"
@martin12333
martin12333 / adb.sh
Created July 18, 2021 17:30 — forked from sofaking/adb.sh
Get battery level via adb
adb shell dumpsys battery | grep level