Skip to content

Instantly share code, notes, and snippets.

@martinmev
martinmev / repair_email_images.py
Created November 8, 2011 17:38
Script is useful for creating the advanced HTML newsletter. It reads the file with the email message created by Mozilla Thunderbird (variable filename) with attached images. It replaces image filenames (it uses MD5 checksum; variables fileImages, ...
#!/usr/bin/env python2.7
# Copyright Martin Mevald 2011.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# settings
fileImages = ['hl1.png','Afrika_party_212px.jpg','vlnovka.png','f.png','distribuce.jpg','teachers_first round_demonstration180px.jpg','vlnovka0.png','rusinga_island_rustinga_1_180px.jpg','IMG_0075_180px.jpg','3_180px.jpg','afrika_nevsednima_ocima_program_partnerstvi_partnerstvi_180px.jpg','zapati.png']
imagesPath = 'C:\\Users\Martin\\Documents\\Bulletin\\'
filename='C:\\Users\\Martin\\Documents\\Bulletin Centra Narovinu.eml'
@martinmev
martinmev / characterSetMappingTables.jl
Last active August 29, 2015 14:20
This Julia Gist generates the character set mapping dictionaries from the mappings files (8 bit characters to Unicode; ftp.unicode.org/Public/MAPPINGS/) and it decodes the text from a given code page.
using HDF5, JLD
# https://www.dropbox.com/s/o4ys5z3p7ogircd/characterSetMappingTables.jld?dl=0
@load "c:\\Users\\Martin\\Downloads\\MAPPINGS\\characterSetMappingTables.jld"
function printEncodings()
for mappingTable in sort(collect(keys(characterSetMappingTables)))
println(mappingTable)
end
end
@martinmev
martinmev / touchtest.html
Last active August 29, 2015 14:16
Detection (Javascript): Click (Desktop) or Touch (Touch device)?
<html>
<body>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script language="javascript">
mouseOverTime = 0;
@martinmev
martinmev / gist:444619fbdec82864a025
Created June 1, 2014 11:18
Export contacts from Nokia Suite
import sqlite3
import json
conn = sqlite3.connect('c:\\Users\\Martin\\AppData\\Local\\Nokia\\Nokia Data Store\\DataBase\\MDataStore.db3')
data = {}
cursor = conn.execute("select * from contact")
rows = cursor.fetchall()
getRowData = lambda r : ' '.join([x if x else '' for x in r]).strip()
@martinmev
martinmev / gist:fdc3462e62b039a910c4
Created June 1, 2014 11:09
Dump Nokia Suite SQLite database
import sqlite3
conn = sqlite3.connect('c:\\Users\\Martin\\AppData\\Local\\Nokia\\Nokia Data Store\\DataBase\\MDataStore.db3')
for i in conn.iterdump():
print(i)