Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

David Miranda panphora

🎯
Focusing
Block or report user

Report or block panphora

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View slow-down-twitch-chat.js
// INSTRUCTIONS
// 1. paste in Google Chrome dev console
// 2. enjoy!
// don't display any chat messages by default
var style = document.createElement("style");
style.appendChild(document.createTextNode(""));
document.head.appendChild(style);
style.sheet.insertRule("body .ember-chat .chat-messages .chat-line {display: none;}", 0);
View overcast.js
window.addEventListener("keydown", (event) => {
if (event.keyCode === 32) {
event.preventDefault();
if (player.paused) player.play(); else player.pause();
}
});
@panphora
panphora / expand-podcast-to-see-episodes.js
Created Sep 14, 2017
Modifying overcast.fm to make it more like the app
View expand-podcast-to-see-episodes.js
var $activeEpisodes = $(".episodecell");
var episodesReversedElements = $activeEpisodes.toArray().reverse();
var lastPodcastName;
episodesReversedElements.forEach(function (elem) {
var $activeEpisode = $(elem);
var podcastName = $activeEpisode.find(".titlestack div:first-child").text();
var podcastImgSrc = $activeEpisode.find(".art").attr("src");
if (podcastName !== lastPodcastName) {
View notify.js
const mailgun = require('mailgun-js')({apiKey: api_key, domain: domain});
const twilio = new require('twilio')(accountSid, authToken);
export default function notify (to, msg, options) {
if (Array.isArray(to)) {
to.forEach((toSingle) => notify(toSingle, msg, options));
return;
}
if (to.includes("@")) {
View overcast.fm - just show podcast title.js
var $activeEpisodes = $(".episodecell");
var episodesReversedElements = $activeEpisodes.toArray().reverse();
var lastPodcastName;
episodesReversedElements.forEach(function (elem) {
var $activeEpisode = $(elem);
var podcastName = $activeEpisode.find(".titlestack div:first-child").text();
var podcastImgSrc = $activeEpisode.find(".art").attr("src");
if (podcastName !== lastPodcastName) {
View Native Vanilla JS $.getScript function with callback.js
function getScript(source, callback) {
var scriptElement = document.createElement('script');
var priorScriptElement = document.getElementsByTagName('script')[0];
scriptElement.async = 1;
scriptElement.onload = scriptElement.onreadystatechange = function( _, isAbort ) {
if (isAbort || !scriptElement.readyState || /loaded|complete/.test(scriptElement.readyState) ) {
scriptElement.onload = scriptElement.onreadystatechange = null;
scriptElement = undefined;
View displayTimeLeft.js
function displayTimeLeft (endDate) {
var msUntilDate = endDate - (new Date).getTime();
var secs = Math.floor(msUntilDate / 1000) // total seconds until end date
, mins = Math.floor(secs / 60) // total minutes until end date
, hours = Math.floor(mins / 60) // total hours until end date
, days = Math.floor(hours / 24); // total days until end date
secs = secs % 60; // seconds remaining after dividing by 60 -- for display in countdown
mins = mins % 60; // minutes remaining after dividing by 60 -- for display in countdown
@panphora
panphora / contact.php
Last active Jan 9, 2019 — forked from libryder/contact.php
Super simple PHP contact form in one file
View contact.php
<html>
<head>
<title>Contact Us</title>
</head>
<body>
<?php
if ($_POST['message']) {
$message = $_POST['message'];
View query.js
/*
# Description
A light jQuery replacement that takes a selector and returns an instance with helper methods.
# API
## event delegation
View forEachNestedData.js
// DESCRIPTION:
// ============
// loops through all items in a nested object/array
//
// USE:
// ===
// forEachNestedData({currentItem, callback});
//
// OUTPUT:
// ======
You can’t perform that action at this time.