Skip to content

Instantly share code, notes, and snippets.

@jtmoon79
jtmoon79 / python-embedded-for-Win10.md
Last active May 13, 2024 14:32
fully configuring embedded Python on Windows 10

Update: use PowerShell script PythonEmbed4Win.ps1.

The instructions in this gist have some subtle problems and this gist will not be updated.

About


@wpmudev-sls
wpmudev-sls / forminator-entry-id-in-response.php
Last active February 23, 2024 02:32
[Forminator] - Submission id in response messag. This snippet allows to use the submission id in response messages. The following macro can be used in the content `{submission_id}`
<?php
/**
* Plugin Name: [Forminator] - Submission id in response message
* Plugin URI: https://premium.wpmudev.org/
* Description: This snippet allows to use the submission id in response messages. The following macro can be used in the content `{submission_id}`
* Author: Panos Lyrakis, Amit Sonkhiya @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* Task: SLS-2683
* License: GPLv2 or later
*/
@nicwolff
nicwolff / XML_breaker.py
Last active March 14, 2024 02:11
Python script to break large XML files
import os
import sys
from xml.sax import parse
from xml.sax.saxutils import XMLGenerator
class CycleFile(object):
def __init__(self, filename):
self.basename, self.ext = os.path.splitext(filename)
self.index = 0
@jmervine
jmervine / cert_convert.sh
Created November 17, 2014 21:57
openssl: convert cert from p7b to crt (or cer)
openssl pkcs7 -print_certs -in old.p7b -out new.crt
# openssl pkcs7 -print_certs -in old.p7b -out new.cer
@lawlesst
lawlesst / cleaner.py
Created November 19, 2012 14:29
cleaning invalid characters from xml
def invalid_xml_remove(c):
#http://stackoverflow.com/questions/1707890/fast-way-to-filter-illegal-xml-unicode-chars-in-python
illegal_unichrs = [ (0x00, 0x08), (0x0B, 0x1F), (0x7F, 0x84), (0x86, 0x9F),
(0xD800, 0xDFFF), (0xFDD0, 0xFDDF), (0xFFFE, 0xFFFF),
(0x1FFFE, 0x1FFFF), (0x2FFFE, 0x2FFFF), (0x3FFFE, 0x3FFFF),
(0x4FFFE, 0x4FFFF), (0x5FFFE, 0x5FFFF), (0x6FFFE, 0x6FFFF),
(0x7FFFE, 0x7FFFF), (0x8FFFE, 0x8FFFF), (0x9FFFE, 0x9FFFF),
(0xAFFFE, 0xAFFFF), (0xBFFFE, 0xBFFFF), (0xCFFFE, 0xCFFFF),
(0xDFFFE, 0xDFFFF), (0xEFFFE, 0xEFFFF), (0xFFFFE, 0xFFFFF),
@leehsueh
leehsueh / boolparser.py
Created October 16, 2011 09:07
Python Boolean Expression Parser/Evaluator
"""
Grammar:
========
Expression --> AndTerm { OR AndTerm}+
AndTerm --> Condition { AND Condition}+
Condition --> Terminal (>,<,>=,<=,==) Terminal | (Expression)
Terminal --> Number or String or Variable
Usage:
======