Skip to content

Instantly share code, notes, and snippets.

@webster
webster / HTML language
Created November 22, 2011 18:40 — forked from kornelski/HTML language
TextMate HTML language tweaked to support unquoted attributes
{ scopeName = 'text.html.basic';
firstLineMatch = '<!DOCTYPE|<(?i:html)|<\?(?i:php)';
fileTypes = ( 'html', 'htm', 'shtml', 'xhtml', 'phtml', 'php', 'inc', 'tmpl', 'tpl', 'ctp' );
foldingStartMarker = '(?x)
(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)\b.*?>
|<!--(?!.*--\s*>)
|^<!--\ \#tminclude\ (?>.*?-->)$
|<\?(?:php)?.*\b(if|for(each)?|while)\b.+:
|\{\{?(if|foreach|capture|literal|foreach|php|section|strip)
|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
@webster
webster / turn-off-directv-dvrs-local-network.sh
Created May 23, 2012 16:43
Turn off all DirecTV DVRs on a local network
#
# Turn off all DirecTV DVRs on a local network
#
# DirecTV DVRs manufactured after some time in 2010 have an API running on
# port 8080 - as long as you can hit the port, you can run commands to change
# channels, get show information, etc. - without authentication
#
# Requires nmap and curl
# Change the IP range to match the local subnet CIDR
#
{
"ranges": {
"Hennepin County": [
["204.73.55.10", "204.73.55.10"],
["137.70.0.0", "137.70.255.255"]
],
"City of Minneapolis": [
["206.55.176.8", "206.55.176.15"],
["170.159.0.0", "170.159.255.255"],
["198.133.93.0", "198.133.98.255"],

What is @MinnesotaEdits?

@MinnesotaEdits was inspired by and runs the same code as @congressedits. The purpose is to track anonymous changes made to Wikipedia articles by IP addresses used by government agencies in Minnesota, specifically surrounding the Minneapolis-St. Paul metropolitan area.

What government entity really made that change?

You might see a lot of changes being made by "State of Minnesota" but it doesn't mean someone sitting in an office near the Capitol did it. The State of Minnesota assigns its IP addresses to departments, counties, school districts, and cities across the state. It's sometimes easy to tell which agency they've assigned it to, and sometimes not. As more granular information becomes available, future updates to the IP address list will be made. IP addresses can also change hands. Accuracy isn't guaranteed, so be sure to double-check any IP addresses yourself if you're doing some reporting.

Are there any government agencies intentionally removed?

School districts

{
"articles": [
"Abdi Warsame",
"Al Doty",
"Al Franken",
"Al Juhnke",
"Alan Page",
"Albert Hofstede",
"Alice Hausman",
"Alice Johnson (politician)",

What is @mnpol_wikiwatch?

This account sends a tweet out each time the Wikipedia article for a Minnesota politician is edited. The code is based on @congressedits, but instead of tracking IP addresses, it tracks all changes to specific articles.

What politicians are on the list?

The intent is that the list includes all elected and candidate state constitutional officers, state legislators, Hennepin and Ramsey County Commissioners, municipal elected officials in Minneapolis and Saint Paul, and any notable current and former politicians from around the state, erring on the side of being inclusive — provided that they have a Wikipedia article. The actual list is maintained as a JSON file, which you're welcome to contribute changes to via GitHub or by e-mailing me. https://gist.github.com/webster/6c694a7e60556722f77c

Work to be done

  • Create a list of accounts to ignore e.g. AnomieBOT
  • Create aliases so instead of e.g. "Al Franken (Politician)" (or whatever the case may be as reflected on Wikipedia),
{
"politicians": {
"Mike Nelson": {
'article': "Michael Nelson (Minnesota politician)",
'jurisdiction': "Minnesota",
'body': "House of Representatives",
'title': "Rep.",
'district': "40A",
'party': "D"
},
@webster
webster / keybase.md
Created August 13, 2014 04:41
Replaced GPG keys 2014-08-12

Keybase proof

I hereby claim:

  • I am webster on github.
  • I am webster (https://keybase.io/webster) on keybase.
  • I have a public key whose fingerprint is C908 1772 B6A4 2C88 39E3 0F6E 3AA7 10D0 EFE6 7B65

To claim this, I am signing this object:

@webster
webster / nginx secure boilerplate.conf
Created October 10, 2014 19:08
Boilerplate security-focused nginx conf (work in progress)
# This is a work in progress, so don't use it.
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$host$request_uri;
# TODO logging
}
############################################################################
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
PGP Key Transition Statement
Tony Webster <tony@tonywebster.com>
Fri Jun 5 06:49:34 UTC 2015