The default serializer will serialize the entire ruby object of your geospatial column. This custom serializer will serialize it to WKT (WKB isn't an option here without casting). This is much more efficient than serializing the entire ruby object, and much safer.
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
from __future__ import (absolute_import, division, print_function) | |
from functools import wraps | |
from ansible.plugins.connection import ConnectionBase | |
from ansible.plugins.connection.ssh import Connection as SSHConnection | |
def voyage_mount_ro(func): | |
@wraps(func) | |
def _inner(self, *args, **kwargs): | |
super(Connection, self).exec_command('[[ -x /usr/local/sbin/remountro ]] && /usr/local/sbin/remountro') | |
return func(self, *args, **kwargs) |
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
import csv | |
from lxml.html import parse | |
inf = float('inf') | |
base_uri = 'http://www.officialcharts.com' | |
start_page = '/charts/singles-chart/20150828/7501/' | |
positions = {} | |
def parse_page(page): | |
tree = parse(base_uri + page) |
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
[google-chrome] | |
name=google-chrome - $basearch | |
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch | |
enabled=1 | |
gpgcheck=1 | |
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub |
I hereby claim:
- I am lewiseason on github.
- I am lewiseason (https://keybase.io/lewiseason) on keybase.
- I have a public key whose fingerprint is 6890 A599 9D54 B325 5C17 BE2A 80D9 024D 7A1A 6AB6
To claim this, I am signing this object:
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/env python | |
# check - Check status of some web services | |
# and send an email if they're down. | |
# List of checks to perform. Tuples in the form | |
# (url, expected_http_response) | |
sender = 'noreply@example.com' | |
recipient = 'root@example.com' | |
subject = 'Checks Failed' | |
mailserver = 'localhost' |
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 issues | |
_ = issues | |
components.each { |c| _ << c.issues} | |
return _.uniq | |
end |