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 / gist:5887186
Last active July 10, 2022 23:26
Google Script: YouTube Channel Username to 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 / 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 / yt_content_owner_check.php
Created February 19, 2014 20:34
A simple PHP script that checks the content owner of a given YouTube video id.
<?php
/*
Download this file to your local drive and run it thusly:
> php yt_content_owner_check.php [YouTube Video ID]
*/
if(empty($argv[1]))
{
die("Please pass in a YouTube video id.\n");
}
@mikeflynn
mikeflynn / gist:9967684
Last active August 29, 2015 13:58
Mozilla Co-Founder Brendan Eich Resigns as CEO, Leaves Foundation Board

Quoted from: http://recode.net/2014/04/03/mozilla-co-founder-brendan-eich-resigns-as-ceo-and-also-from-foundation-board/

A crisis indeed, not helped much by a series of Eich interviews this week, in which he declined to apologize and used what can only be described as pretzel logic about how a clearly tolerant community like Mozilla should also support what many now consider intolerant beliefs.

Eich told the Guardian, for example: “So far we’ve been able to bring people together of diverse beliefs including on things like marriage equality. We couldn’t have done this, we couldn’t have done Firefox One. I would’ve been excluded, someone else would’ve been excluded because of me — I wouldn’t have done that personally, they’d have just left. So imagine a world without Firefox: not good.”

>He also dragged in a truly bizarre point about people in Indonesia not liking gays marrying to justify his continued leadership. He noted to the newspaper that LGBT marriage was “not considered universal human rights y

@mikeflynn
mikeflynn / stltodayfree.user.js
Last active August 29, 2015 14:00
** Latest version here: https://github.com/mikeflynn/stltoday-paywall-buster ** A browser user script to prevent the STLToday.com paywall from activating by simply marking the content as free. See how to install this on your browser of choice (Chrome or Firefox are preferred) here: http://wiki.greasespot.net/Cross-browser_userscripting
// ==UserScript==
// @name "STLToday Free"
// @version 2.2
// @description "A user script to automatically bypass the paywall by marking the content as free."
// @match http://*.stltoday.com/*
// @run-at document-start
// ==/UserScript==
function updateMetaTag() {
var m = document.getElementsByTagName('meta');
@mikeflynn
mikeflynn / 0_reuse_code.js
Created June 1, 2014 07:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@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(
// 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 / 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)) {
#!/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: