Skip to content

Instantly share code, notes, and snippets.

View elidickinson's full-sized avatar

Eli Dickinson elidickinson

View GitHub Profile
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.1
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http://*
// ==/UserScript==
--- MySQL-python-1.2.3/setup_posix.py 2010-06-17 09:21:56.000000000 +0200
+++ MySQL-python-1.2.3-patched/setup_posix.py 2013-11-12 13:05:44.028407794 +0100
@@ -85,6 +85,7 @@
]
create_release_file(metadata)
del metadata['version_info']
+ libraries.append('stdc++')
ext_options = dict(
name = "_mysql",
library_dirs = library_dirs,
@elidickinson
elidickinson / Sass Compact.sublime-build
Last active August 29, 2015 14:06
Sass/scss build config for Sublime Text
{
"cmd": ["sass", "--update", "$file:${file_path}/${file_base_name}.css", "--no-cache", "--style", "compact"],
"selector": "source.sass, source.scss",
"file_regex": "error (/.*.scss) .Line ([0-9]+):",
"osx": {
"path": "/usr/local/var/rbenv/shims/:/usr/local/bin:$PATH"
},
"windows": {
"shell": "true"
}
To check if the system is vulnerable:
env x='() { :;}; echo vulnerable' bash -c /bin/bash
returns 'vulnerable'
import dns.resolver
import csv
import re
import sys
domain_cache = {}
def test_email_domain(domain):
if domain is None:
return False
load data local infile 'c:/fierce/fwe_opens.csv' ignore into table opens fields
TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
lines terminated by '\n'
(email,@check_time,@last_open,total_opens)
set mlid = 102866,
check_time = from_unixtime(@check_time),
last_open = if(@last_open<=0,NULL,date(from_unixtime(@last_open)))
;
@elidickinson
elidickinson / print_weather.py
Created February 17, 2011 21:20
Send weather updates to your HP Printer LCD dispaly
#!/usr/bin/python
import pywapi # http://code.google.com/p/python-weather-api/
import telnetlib
import sys
if len(sys.argv) != 3:
print "USAGE: python print_weather.py <ZIPCODE> <PRINTER_IP>"
exit()
location_id = sys.argv[1]
@elidickinson
elidickinson / merge_feeds_with_simplepie.php
Created March 14, 2011 17:15
Merge feeds in PHP with simplepie
<?php print '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>FierceWireless</title>
<link>http://www.fiercewireless.com</link>
<description>
The latest wireless industry news from FierceWireless
</description>
<language>en-us</language>
@elidickinson
elidickinson / mysql_extract_domain.sql
Created March 28, 2011 00:25
MySQL extract domain
# domain from email address
SELECT mid(email from locate('@',email)+1) as domain FROM emails;
# domain from URL (hacky)
SELECT MID(url,8,LOCATE('/',url,8)-8) AS domain FROM clicks
@elidickinson
elidickinson / scrapbio.py
Created May 18, 2011 20:53
scrap bio exhib
# First: wget --random-wait --wait=2 --limit-rate=100K http://e.mybio.zerista.com/exhibitor?exhibitor_page={1..142}
# But that saves them with a stupid name, so rename using:
# ls -d exhib* | sed 's/\(.*\)=\(.*\)$/mv "&" "bio\2.html"/' | sh
#
from BeautifulSoup import BeautifulSoup
import csv
import glob
import os
writer = csv.writer(open("bio.csv", "wb"))