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
@mikeflynn
mikeflynn / videos.clj
Created August 17, 2013 06:36
Pulling the video list for a YouTube channel.
(ns ytsubs.videos
(:require [cheshire.core :as json]))
(def user {:channel_id "UCVmqfvWsKeFaMGY68CbcVVQ"
:refresh_token ""})
(def client {:apikey "AIzaSyDCTxAB0aNIuyX-rZyidHCypPlO7owtYKY"
:id ""
:secret ""})
@mikeflynn
mikeflynn / chromebook_pixel_setup.md
Last active December 17, 2015 11:38
My various Chromebook Pixel setup notes

Chromebook Pixel Configuration

What does this do? Good question. What you will end up with is essentially Chrome OS and Ubuntu (with KDE) running side by side.

1. Get in to developer mode

Hold down ESC + REFRESH + POWER, when it reboots hit CTRL + D, and ENTER to confirm.

(You will have to hit CTRL + D at ever boot when you see the scary dev mode OS screen.)

(defn parse-xml [xml]
(try
(xml/parse (java.io.ByteArrayInputStream. (.getBytes (.trim xml))))
(catch Exception e {})))
@mikeflynn
mikeflynn / .gitconfig
Created July 3, 2012 16:03
My work ~/.gitconfig file
[color]
branch = auto
diff = auto
status = auto
interactive = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
;; Namespaces, Symbols, and Vars (Oh, My!) -- @craigandera
;; require = "load"
;; dots => slashes, dash => underscore in require to file
(require '[net.cgrand.enlive-html :as html]) ...you can alias by passing the list elements as sequence.
;; * Single quoting above sequence the reading of the sequence as evaluating happens.
(ns some.name)
@mikeflynn
mikeflynn / hue.go
Last active October 5, 2015 07:07
Hue lights API in Go
package main
import (
"bytes"
"encoding/json"
"errors"
"io/ioutil"
"net/http"
"strings"
)
@mikeflynn
mikeflynn / dashbutton_sniff.go
Last active October 5, 2015 06:04
The network sniffing functionality for the Amazon Dash Button hack.
func SnifferStart() {
// Get a list of all interfaces.
ifaces, err := net.Interfaces()
if err != nil {
panic(err)
}
var wg sync.WaitGroup
for _, iface := range ifaces {
wg.Add(1)
@mikeflynn
mikeflynn / Sorting Code Challenge.php
Created March 20, 2012 05:40
given a list of words, i need every unique combination where the list is in alphabetical order.
<?php
function order_list($words, &$return = null)
{
if(!$return) $return = array();
sort($words);
$string = implode(', ', $words);
if(!empty($string) && !in_array($string, $return)) $return[] = $string;
@mikeflynn
mikeflynn / lmi_json_check.clj
Created March 19, 2012 22:41
1st clojure script to find the bad json strings in a file.
#_(defdeps ; defeps call for lein oneoff
[[org.clojure/clojure "1.3.0"]
[clj-json "0.5.0"]])
(ns jsoncheck
(:require [clj-json [core :as json]]
[clojure.java.io :as io]))
(defn processfile [file-name checkfn]
"Takes file path and function to parse each line."
@mikeflynn
mikeflynn / gist:1131156
Created August 8, 2011 03:27
How to kill tynt's copy/paste bullsh*t
1. Open terminal and type "sudo vi /etc/hosts"
2. Add the following lines at the bottom of the file:
127.0.0.1 tcr.tynt.com
127.0.0.1 tynt.com
3. type: [esc], then ":wq" and close terminal
4. Go to http://tcr.tynt.com/ti.js in your browser of choice. Your browser won't find it and you can copy/paste without added crap!