Skip to content

Instantly share code, notes, and snippets.

@toffer
toffer / title-id.md
Last active April 26, 2021 14:13
nv/immunizenevada_org parsing:: compare title and generated ID
Title ID
Albertsons #1059 albertsons-1059
Albertsons #118 albertsons-118
Albertsons #2 albertsons-2
Albertsons #276 albertsons-276
Albertsons #2804 albertsons-2804
Albertsons #3016 albertsons-3016
Albertsons #3021 albertsons-3021
Albertsons #3205 albertsons-3205
@toffer
toffer / nv.json
Created April 24, 2021 22:14
immunizenevada_org fetch results.
[
{
"command": "settings",
"settings": {
"pluralDelimiter": "\u0003",
"suppressDeprecationErrors": true,
"ajaxPageState": {
"libraries": "better_exposed_filters/general,bootstrap_barrio/form,geolocation/map_center.static_location,geolocation_leaflet/commonmap.leaflet,geolocation_leaflet/mapfeature.leaflet_control_zoom,geolocation_leaflet/mapfeature.leaflet_marker_popup,views/views.ajax,views/views.module",
"theme": "bootstrap_barrio_subtheme",
"theme_token": null
@toffer
toffer / PythonServer.py
Last active August 29, 2015 14:24
Modified server from Thrift tutorial, to demonstrate how to record thrift transactions as background tasks. PythonClient.py is unchanged.
#!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
@toffer
toffer / task.py
Created June 3, 2014 17:59
An example of manually instrumenting a background task, without using the newrelic-admin wrapper script.
#!/usr/bin/env python
import os
import newrelic.agent
# Initialize the New Relic agent as early as possible.
config_file = os.environ.get('NEW_RELIC_CONFIG_FILE')
newrelic.agent.initialize(config_file)
@toffer
toffer / Dockerfile.devbox
Last active January 2, 2016 04:28
Dockerfile for Devbox
# Dockerfile for Devbox
FROM racker/precise-with-updates:latest
MAINTAINER Tom Offermann <tom@offermann.us>
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN echo "deb http://archive.ubuntu.com/ubuntu/ precise-updates main universe" >> /etc/apt/sources.list
RUN echo "deb http://security.ubuntu.com/ubuntu precise-security main universe" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get -y upgrade
@toffer
toffer / slumber-twitter-client.py
Created March 2, 2012 22:45
Use OAuth with slumber
#!/usr/bin/env python
# An example of modifying the session of a slumber.API instance,
# in order to use OAuth authentication and turn on verbose logging.
import requests
import slumber
import sys
# from https://github.com/maraujop/requests-oauth
<ul id="twitter_update_list"></ul>
<script type="text/javascript"
src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript"
src="http://twitter.com/statuses/user_timeline/MichRee.json?callback=twitterCallback2&amp;count=2">
</script>
<ul id="toffermann_twitter_updates"></ul>
<script type="text/javascript"
src="http://twitter.com/statuses/user_timeline/toffermann.json?callback=twitterCallback2&amp;count=2">
</script>
<ul id="MichRee_twitter_updates"></ul>
<script type="text/javascript" src="/wp-includes/js/twitter-simple.js"></script>
<script type="text/javascript"
src="http://twitter.com/statuses/user_timeline/MichRee.json?callback=twitterCallback2&amp;count=2">
</script>
function twitterCallback2(C)
{
var A = [];
for (var D = 0; D < C.length; ++D)
{
var E = C[D].user.screen_name;
var B = C[D].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function (F)
{
return "<a href=\"" + F + "\">" + F + "</a>";
}).replace(/\B@([_a-z0-9]+)/ig, function (F)