Skip to content

Instantly share code, notes, and snippets.

@austinpray
austinpray / twitchplayspokemonfilter.js
Last active August 29, 2015 13:56
Filters TwitchPlaysPokemon chat
var chatButton = $("ul.segmented_tabs li a").first();
$("<li><a class='CommandsToggle'>Commands</a><a class='ChatToggle'>Talk</a></li>").insertAfter(chatButton);
chatButton.css("width", chatButton.width() - 71);
$(".CommandsToggle").click(function () {
"use strict";
$("a.CommandsToggle").toggleClass("selected");
if ($(".commandsHideCSS").length !== 0) {
$(".commandsHideCSS").remove()
} else {
$("<style type='text/css' class='commandsHideCSS'>#chat_line_list li.cSpam{display:inline;}</style>").appendTo("head")
<!doctype html>
<html>
<head>
<!-- Run in full-screen mode. -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Make the status bar black with white text. -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
@austinpray
austinpray / gtm_page_load.js
Created June 6, 2014 17:18
GTM Page loaded user timing
var gtmPageLoad = (function (window) {})(window);
var jq = document.createElement('script');
jq.src = '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
document.getElementsByTagName('head')[0].appendChild(jq);
var b, engine;
jq.onload = function () {
var ballscript = document.createElement('script');
ballscript.src = 'https://rawgit.com/austinpray/pro-grid-utils/master/ball_mod.js';
document.getElementsByTagName('head')[0].appendChild(ballscript);
ballscript.onload = function () {
b = new ball();
convert test*.png -resize 595x842 -gravity center -background white \
-extent 595x842 jason.pdf
function getPresentationTitle() {
var metas = document.getElementsByTagName('meta');
for (i=0; i<metas.length; i++) {
if (metas[i].getAttribute("name") === "og:title") {
return metas[i].getAttribute("content");
}
}
return "";
}
@austinpray
austinpray / getselectedoptiontext.js
Created July 10, 2014 15:51
Could you please whip up some javascript to pull the value from the dropdown menu of the contact form here? https://www.hahnpublic.com/contact/
function () {
var subjectDropdown = document.getElementsByName('recipient_email')[0];
return subjectDropdown.options[subjectDropdown.options.selectedIndex].text
}
@austinpray
austinpray / hahnsearchbar.js
Created July 10, 2014 16:17
And the value plugged into the search bar in the top right corner.
function () {
var searchEl = typeof document.querySelector !== 'undefined' ? document.querySelector('#search [name="keywords"]') : document.getElementsByName('keywords')[0];
return searchEl.value;
}
@austinpray
austinpray / servers.json
Last active August 29, 2015 14:03
ryan schema
{
"districts": [
{
"objectType": "district",
"code": "RISD",
"alert": false,
"servers": [
{
"objectType": "server",
"errors": 999,
server {
set $site_name birdforestry.com;
listen *:80;
server_name 162.243.214.186 staging.birdforestry.com;
access_log /srv/www/birdforestry.com/logs/birdforestry.com.access.log;
error_log /srv/www/birdforestry.com/logs/birdforestry.com.error.log;
root /srv/www/birdforestry.com/current/web;
index index.php;