Skip to content

Instantly share code, notes, and snippets.

@renesugar
renesugar / splitmbox.py
Created April 8, 2020 00:57 — forked from technicalflaw/splitmbox.py
Split a Unix-style mailbox into individual files
#! /usr/bin/env python
""" Split a Unix-style mailbox into individual files
Written by Aquarius <aquarius@kryogenix.org>
Usage: splitmbox.py <mailbox-file> <directory>
This will create files numbered 01,02,03... in <directory>. The
number of prefixed zeroes will make all filenames in the
directory the same length. """
#!/usr/bin/env python
# easyIMAP2Notes (C)2015 by Jan-Piet Mens
# Connect to an IMAP mailbox, read messages, and convert them into
# a format suitable for iOS/OSX Notes, then store them in Notes/
#
# This uses two connections (consider that a feature b/c you can
# slurp from one IMAP account into another). The real reason is I
# couldn't be bothered to implement message decoding/attachment
# extraction with imaplib, so I chose easyimap (pip install easyimap)
# to do that.
@renesugar
renesugar / mynote.xml
Created April 7, 2020 23:55 — 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>
@renesugar
renesugar / .gitignore
Created April 7, 2020 23:54
Parsing Evernote export file (.enex) using Python
*.enex
@renesugar
renesugar / emlToMbox.py
Created April 7, 2020 23:53 — forked from kadin2048/emlToMbox.py
Combine a directory of .eml files into a single Unix "mbox" file.
#!/usr/bin/env python
""" Converts a directory full of .eml files to a single Unix "mbox" file.
Accepts as input either an individual .eml file or a directory containing one
or more .eml files.
The output mbox will be created if it doesn't already exist. If it exists,
it will be appended to. There is no checking for duplicates, so use caution.
If duplicate filtering is desired, it could be added to addFileToMbox().
@renesugar
renesugar / CopyableLabel.swift
Created June 15, 2019 02:20 — forked from zyrx/CopyableLabel.swift
Make UILabel Copyable in Swift 3. Special thanks to Stephen Radford and his "Make UILabel Copyable in Swift" article http://stephenradford.me/make-uilabel-copyable/
//
// CopyableLabel.swift
//
// Created by Lech H. Conde on 01/11/16.
// Copyright © 2016 Mavels Software & Consulting. All rights reserved.
//
import UIKit
class CopyableLabel: UILabel {
@renesugar
renesugar / webhook-mailer.php
Created April 25, 2019 22:31 — forked from jcanfield/webhook-mailer.php
Stripe Webhook PHP Example
<?php
// SETUP:
// 1. Customize all the settings (stripe api key, email settings, email text)
// 2. Put this code somewhere where it's accessible by a URL on your server.
// 3. Add the URL of that location to the settings at https://manage.stripe.com/#account/webhooks
// 4. Have fun!
// set your secret key: remember to change this to your live secret key in production
// see your keys here https://manage.stripe.com/account
@renesugar
renesugar / aes.go
Created March 16, 2019 02:06 — forked from tscholl2/aes.go
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"