This is the README file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stringContainsAnyCharacters(string, characters): | |
""" | |
Check whether 'string' contains any characters from string 'characters'. | |
:param string: String to check for wanted characters | |
:type string: str | |
:param characters: String of characters to be found | |
:type characters: str | |
:return: True if any characters are found, False otherwise | |
:rtype: bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Standalone mini version of pip | |
# Geared towards Pythonista, but easily adaptable to other pure python installs | |
import argparse, copy, gzip, os, os.path, re, requests, shutil, site, sys, tarfile, time, xmlrpclib | |
# Where packages will end up installed | |
site_packages = site.USER_SITE | |
# Root of Pythonista saveable document location | |
pythonista_base = os.path.split(site_packages)[0] | |
# Temporary directory for work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r"""Command-line tool to validate and pretty-print JSON | |
Usage:: | |
$ echo '{"json":"obj"}' | python -m json.tool | |
{ | |
"json": "obj" | |
} | |
$ echo '{ 1.2:3.4}' | python -m json.tool | |
Expecting property name enclosed in double quotes: line 1 column 3 (char 2) |
If ntpdate
is installed:
sudo ntpdate pool.ntp.org
To install ntpdate
:
sudo apt-get install ntpdate # for Ubuntu-like
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example of GitHub's geoJSON support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# From http://nedbatchelder.com/blog/200712/human_sorting.html | |
import re | |
def tryint(s): | |
try: | |
return int(s) |
Many websites attempt to validate email addresses based on formatting rules alone. Often, they use regular expressions which may turn out to be wrong, which is difficult to notice due to their complexity. Attempting to do very much validation of email addresses is usually a mistake and should be avoided.
The most common problem I've seen personally, from the perspective of a website user, is that email addresses containing a plus-sign (+
) are considered invalid. For example, an email address like my_name+extra_info@gmail.com
is often rejected as invalid. However, that conclusion is incorrect.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Preferences for Auto Text Expander ℹ️👍😃 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -- | |
# This script is easier to use when in a file named "quopri" without the extension. | |
# The ".sh" extension is helpful for syntax highlighting in GitHub and editors. | |
# For use, it's recommended to either remove the ".sh" from the filename or make a | |
# symbolic link to it named "quopri". | |
# For more information about quopri, see: https://docs.python.org/library/quopri.html | |
python -mquopri "${@}" |
OlderNewer