Skip to content

Instantly share code, notes, and snippets.

View mikeflynn's full-sized avatar
🥪
A little hungry, but overall OK.

Mike Flynn mikeflynn

🥪
A little hungry, but overall OK.
View GitHub Profile
// ==UserScript==
// @name "101ESPN Clean"
// @version 1.0
// @description "Cleans up the reading experience for 101ESPN.com"
// @match http://*.101sports.com/*
// @run-at document-start
// ==/UserScript==
function injectStyles() {
head = document.getElementsByTagName('body')[0];
@mikeflynn
mikeflynn / mux_test.go
Last active August 29, 2015 14:24
Example mux setup.
package main
import (
"log"
"net/http"
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
)
@mikeflynn
mikeflynn / youtube_comment_search_main.go
Last active August 29, 2015 14:22
Takes a YouTube video ID and a list of keywords (and a Google API key); Returns the keywords with a count of how many times they were mentioned.
// Usage:
// 1. Download this file.
// 2. > go build -o yt-comment-search youtube_comment_search.go
// 3. > ./yt-comment-search
package main
import (
"flag"
"log"
@mikeflynn
mikeflynn / wp_export_fmt.php
Created March 23, 2015 16:30
A small PHP script I threw together for formatting my wife's old Wordpress blog export for archival purposes.
<?php
date_default_timezone_set("America/Los_Angeles");
$export_file = $argv[1];
$output_file = $argv[2];
function templateStart($th) {
$html = <<<HEREDOC
<html>
@mikeflynn
mikeflynn / google_docs.js
Created October 14, 2014 18:17
A Google Docs script that adds a formula to find a YouTube channel id.
function ytChannelId(channelName) {
if(channelName) {
var name = getChannelFromUrl(channelName);
var url = "https://gdata.youtube.com/feeds/api/users/" + name + "?fields=id&alt=json";
var result = UrlFetchApp.fetch(url);
var data = Utilities.jsonParse(result.getContentText())
if(typeof data['entry'] !== 'undefined' && data['entry']['id']['$t'] !== 'undefined') {
var id = "UC" + data['entry']['id']['$t'].split('/').pop();
@mikeflynn
mikeflynn / r53transfer.sh
Created October 2, 2014 18:08
Route 53 Injection From Text File
#!/usr/bin/env bash
while read LINE; do
IFS=" " read -ra ADDR <<< "$LINE"
if [ "${ADDR[3]}" != "MX" ] && [ "${ADDR[3]}" != "TXT" ]; then
#echo "${ADDR[0]} ${ADDR[3]} ${ADDR[4]}"
aws route53 change-resource-record-sets --hosted-zone-id ZIDF9Q1FLNOC6 --change-batch '{"Changes": [{"Action": "CREATE", "ResourceRecordSet": {"Name": "'${ADDR[0]}'", "Type": "'${ADDR[3]}'", "TTL": 600, "ResourceRecords": [{"Value": "'${ADDR[4]}'"}]}}]}'
fi
done < /Users/mikeflynn/Downloads/infile.txt
#!/bin/bash
#
# GLASSHOLE.SH
#
# Find and kick Google Glass devices from your local wireless network. Requires
# 'beep', 'arp-scan', 'aircrack-ng' and a GNU/Linux host. Put on a BeagleBone
# black or Raspberry Pi. Plug in a good USB wireless NIC (like the TL-WN722N)
# and wear it, hide it in your workplace or your exhibition.
#
# Save as glasshole.sh, 'chmod +x glasshole.sh' and exec as follows:
@mikeflynn
mikeflynn / reddit.js
Created September 3, 2014 05:40
An unfinished and untested Node.js library for the Reddit API. I bailed on it because I found out during testing that the Reddit API is extremely flaky so I'm moving on to something else.
var http = require('http');
exports.reddit = (function(){
var _baseUrl = 'www.reddit.com';
var _modhash = false;
var serialize = function(obj) {
var str = [];
for(var p in obj)
if (obj.hasOwnProperty(p)) {
// Conf
var slackIncoming = require('../lib/slackIncoming').slackIncoming;
function Conf(config, metadata) {
var confConfig = config.load('conf') || {};
this.rooms = confConfig.rooms;
this.metadata = metadata;
}
@mikeflynn
mikeflynn / PBSliderFix.js
Created August 8, 2014 21:53
A quick fix for automatic slider rotation that pauses on mouseover.
jQuery(document).load(function() {
var startRotate = function() {
window.sliderIntervalId = setInterval(function() {
jQuery('i.td-icon-right').click();
}, 5000);
};
startRotate();
jQuery('.iosSlider').hover(