Skip to content

Instantly share code, notes, and snippets.

View thomas-thackery's full-sized avatar

Thomas Thackery thomas-thackery

View GitHub Profile
@thomas-thackery
thomas-thackery / user.js
Created November 18, 2023 05:03
RT Learn Russian play audio
// ==UserScript==
// @name RT Learn Russian play audio
// @version 0.1
// @description try to take over the world!
// @author Красный 13
// @match https://learnrussian.rt.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=rt.com
// @grant none
// ==/UserScript==
@thomas-thackery
thomas-thackery / example.md
Created November 19, 2020 17:10 — forked from dideler/example.md
A python script for extracting email addresses from text files.You can pass it multiple files. It prints the email addresses to stdout, one address per line.For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.

The program below can take one or more plain text files as input. It works with python2 and python3.

Let's say we have two files that may contain email addresses.

file_a.txt

foo bar
ok ideler.dennis@gmail.com sup
 hey...user+123@example.com,wyd
hello world!
@thomas-thackery
thomas-thackery / redirect-from-json.php
Created July 4, 2019 00:00 — forked from SteveRyan-ASU/redirect-from-json.php
Pantheon: Redirect via JSON feed in private file section
// PHP snippet included in wp-config.php (or settings.php).
// Including from that location in a separate file is OK as well.
<?php
// Remove any leading "www." from the host name.
$redirect_host = str_replace('www.', '', $_SERVER['HTTP_HOST']);
$redirect_path = strtolower(rtrim($_SERVER['REQUEST_URI']));
if (strlen($redirect_path) > 2) {
$redirect_path = rtrim($redirect_path, '/');
}
@thomas-thackery
thomas-thackery / wp-nav-menu-parameters.php
Created May 2, 2019 13:54 — forked from zgordon/wp-nav-menu-parameters.php
Demo of the possible menu parameters for wp_nav_menu
<?php
$args = [
// Location pickable in Customizer
'theme_location' => 'main-menu',
// Assigns a default menu to location
'menu' => 'Main Menu',
// Main wrapper around the ul of posts
'container' => 'div',
'container_class' => 'container-class',
'container_id' => 'container-id',
@thomas-thackery
thomas-thackery / pantheon-redirect-env-to-custom-domain.php
Created September 14, 2018 02:28
Pantheon redirect environment to custom domain
#Set the $base_url parameter if we are running on Pantheon:
if (defined('PANTHEON_ENVIRONMENT')) {
if (PANTHEON_ENVIRONMENT == 'dev') {
$domain = 'sandbox.mysite.com';
}
else if (PANTHEON_ENVIRONMENT == 'test') {
$domain = 'staging.mysite.com';
}
else if (PANTHEON_ENVIRONMENT == 'live') {
<!-- in the header -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="scripts/jquery-2.1.1.min.js"><\/script>')</script>
<!-- document ready -->
<script>
$(document).ready(function() {
var customHTML = "<h2>Jeg elsker brød</h2>"
@thomas-thackery
thomas-thackery / designer.html
Last active August 29, 2015 14:17
designer
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<link rel="import" href="../topeka-elements/topeka-datasource.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@thomas-thackery
thomas-thackery / dynamic-date-in-footer.js
Last active August 29, 2015 14:07
Dynamic Date in Footer (javaScript jQuery)