Skip to content

Instantly share code, notes, and snippets.

import sys
import requests
URL_BASE = "https://gis.arlingtonva.us:6443/arcgis/rest/services/"
TIMEOUT = 5
def find_address_candidate(single_line):
path = "geoproc/Composite_Add_loc/GeocodeServer/findAddressCandidates"
params = {

Keybase proof

I hereby claim:

  • I am dbarlett on github.
  • I am dbarlett (https://keybase.io/dbarlett) on keybase.
  • I have a public key whose fingerprint is D390 1F78 78B3 BBE1 EB45 0A56 3D2B 7980 F813 306D

To claim this, I am signing this object:

# http://www.gravityhelp.com/documentation/page/Web_API#Security
import time
import base64
import urllib
import requests
import json
import hmac
from hashlib import sha1
@dbarlett
dbarlett / dnb.py
Created November 10, 2013 21:46
Sample code for authenticating and requesting data from D&B Direct API. Tested with Python 2.7.5 and Requests 2.0.1.
#!/usr/bin/env python
"""Sample code for authenticating and requesting data from D&B Direct API. See
http://developer.dnb.com/ for more information.
"""
import requests # pip install requests
# Register at http://developer.dnb.com/register-v2
DNB_USERNAME = ""
<?php
/*
* This file generates the default booking form fields. Events Manager Pro does not use this file.
*/
/* @var $EM_Event EM_Event */
//Here we have extra information required for the booking.
?>
<?php if( !is_user_logged_in() && apply_filters('em_booking_form_show_register_form',true) ): ?>
<?php //User can book an event without registering, a username will be created for them based on their email and a random password will be created. ?>
<input type="hidden" name="register_user" value="1" />
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Songlister</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
</head>
<body>
<!-- Add your site or application content here -->
@dbarlett
dbarlett / s3-sample-policy.diff
Created May 11, 2013 00:20
Fix invalid JSON for W3TC S3 sample policy
Index: s3-sample-policy.txt
===================================================================
--- s3-sample-policy.txt (revision 711148)
+++ s3-sample-policy.txt (working copy)
@@ -15,9 +15,9 @@
},
{
"Sid": "Stmt1339423675422",
- "Action":s3:List*?,
+ "Action":"s3:List*?",
@dbarlett
dbarlett / ansible-standalone.yml
Last active January 11, 2020 22:57
Standalone Ansible playbook for (X)ubuntu post-install tasks.
---
- hosts: ubuntu
user: admin
sudo: yes
tasks:
- name: Test distribution
fail: msg="Not Ubuntu, aborting"
when_string: $ansible_distribution != "Ubuntu"
@dbarlett
dbarlett / ubuntu-fail2ban.yml
Created March 4, 2013 03:34
Install and configure fail2ban for ssh and Apache protection on Ubuntu
---
# Install and configure fail2ban for ssh and Apache protection
- name: Install fail2ban
apt: pkg=fail2ban
state=present
update_cache=yes
- name: Create local fail2ban config
command: cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
creates=/etc/fail2ban/jail.local