Skip to content

Instantly share code, notes, and snippets.

Martin Mevald martinmev

Block or report user

Report or block martinmev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
martinmev /
Created Nov 8, 2011
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
# 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 / email_export_from_Drupal_Simplenews.sql
Last active Jun 22, 2018
Intelligent mailing list (password protected) - it sends the email message to the list of the email addresses.
View email_export_from_Drupal_Simplenews.sql
------------ Email export from the Drupal Simplenews module
--- get Simplenews private key
select * from drupal_variable where name='simplenews_private_key';
-- +------------------------+------------------------------------------+
-- | name | value |
-- +------------------------+------------------------------------------+
-- | simplenews_private_key | s:32:"00000000000000000000000000000000"; |
martinmev / .zshrc
Last active Oct 8, 2017
Drupal, Galleria field - mass image upload; Ubercart - add images to product. Python scripts create sql commands. Z Shell functions for easy use included.
View .zshrc
setopt extended_glob csh_null_glob
maintenance() {
echo "Maintenance mode."
cat <<EOF | mysql -u drupal -pPASSWORD drupal && echo "OK."
DELETE FROM variable WHERE name = 'site_offline';
INSERT INTO variable (name, value) VALUES ('site_offline', 's:1:"1";');
DELETE FROM cache WHERE cid = 'variables';
martinmev / gist:1397560
Created Nov 27, 2011
Patch for OnlinePHP-IDE ( It removes the message box ' is not a common textual file type'
View gist:1397560
diff --git a/www/php-ide/js/ide_bottom_script.js b/www/php-ide/js/ide_bottom_script.js
--- a/www/php-ide/js/ide_bottom_script.js
+++ b/www/php-ide/js/ide_bottom_script.js
@@ -256,9 +256,6 @@ function open_file(file) {
'py', 'inc', 'txt', 'htaccess', 'htpassword', 'sql', 'xml', 'conf'];
if (typeof file != 'string') file = file.toString();
- if (!file.match(new RegExp('\\.(' + allow_extension.join('|') + ')$'), 'g')) {
martinmev / php_ide_ssl.diff
Created Dec 27, 2011
Patch for Online PHP-IDE ( added FTP SSL connection
View php_ide_ssl.diff
diff --git a/www/php-ide/application/model/ftp.class.php b/www/php-ide/application/model/ftp.class.php
--- a/www/php-ide/application/model/ftp.class.php
+++ b/www/php-ide/application/model/ftp.class.php
@@ -5,12 +5,12 @@
//create:2004-6-23 09:22
+//modify: 2011-12-30 - Martin Mevald, - added SSL connection
martinmev / ftp.class.php
Created Dec 27, 2011
Whole ftp.class.php with SSL
View ftp.class.php
//ftp class
//create:2004-6-23 09:22
//modify: 2011-12-30 - Martin Mevald, - added SSL connection
martinmev / README.txt
Created Aug 23, 2012
Modified Drupal module Galleria
View README.txt
Modified Drupal module Galleria
The example of the modified galleria:
Galleria 6.x-1.0
martinmev /
Created Sep 16, 2012
Script gets email addresses from the text (first argument). Emails are written to the output file (second argument).
#!/usr/bin/env python
import sys
import re
getEmails = re.compile(r'[\w\-][\w\-\.]+@[\w\-][\w\-\.]+[a-zA-Z]{1,4}')
found = set()
for c in content:
martinmev /
Last active Dec 10, 2015
Script gets delivery errors from mbox file.
#!/usr/bin/env python
import sys
def writeErrors(mbox,filename):
isMessage=lambda c: mbox[c].strip()=='The mail system'
getMessage = lambda c,s: s if mbox[c].strip()=='' else s+' '+getMessage(c+1,mbox[c].strip())
while counter<len(mbox):
martinmev / flat.pde
Last active Dec 15, 2015
Simple plan of flat created in Processing
View flat.pde
// Copyright Martin Mevald 2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// PDFs and PNGs:
import processing.pdf.*;
You can’t perform that action at this time.