Skip to content

Instantly share code, notes, and snippets.

View timlg07's full-sized avatar

Tim Greller timlg07

View GitHub Profile
@kidino
kidino / token-login.php
Created December 1, 2018 03:02
Login to WordPress web with JWT
<?php
/*
JWT TOKEN LOGIN -- Automatically logs a user in a WordPress site with JWT
This script allows you to log a user into a WordPress site automatically
based on his/her JSON Web Token (JWT). This assumes that you use the
following plugin and set it up properly on your WordPress site to enable
JWT authentication via REST API.
JWT Authentication for WP REST API
@Grub4K
Grub4K / input.bat
Last active May 13, 2023 20:47
Advanced user input in batch [using xcopy]
@echo off
setlocal enableDelayedExpansion
:::::
:: Advanced user input in batch [using xcopy]
:: Fetch result using for /f from main
:::::
set "prompt="
:: the input prompt
set "symbol="
:: the symbol that displays instead
@ffoodd
ffoodd / improved-sr-only.markdown
Last active July 11, 2025 11:22
Improved .sr-only

Improved .visually-hidden

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@johannesjo
johannesjo / table-to-json.js
Last active October 9, 2024 06:06
Snippet to convert html table to json (to be used with google chrome or similiar)
function tableToJson(table) {
var data = [];
// first row needs to be headers
var headers = [];
for (var i=0; i<table.rows[0].cells.length; i++) {
headers[i] = table.rows[0].cells[i].innerHTML.toLowerCase().replace(/ /gi,'');
}
// go through cells
@sarink
sarink / private.js
Last active December 25, 2022 21:56
// Sample demo of how to gain access to "private" variables in JavaScript,
// even if they'd normally be inaccessible due to the closure.
var Table = function () {
var _array = ["super", "secret", "message"];
return {
get: function (i) { return _array[i]; },
store: function (i,v) { _array[i] = v; },
append: function (v) { _array.push(v); }
};
};
@creaktive
creaktive / rule110-full.html
Created August 16, 2012 14:59
Rule 110 HTML+CSS
<!DOCTYPE html>
<!-- http://eli.fox-epste.in/rule110-full.html -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Rule 110</title>
<style type="text/css" media="screen">
body {
-webkit-animation: bugfix infinite 1s;
font-family: "Courier New";
@mikeschinkel
mikeschinkel / root-based-category-urls.php
Created December 2, 2011 01:28
Enabled Root-based Category URLs in WordPress (Any bugs? Post comments below.)
<?php
/*
* Plugin Name: Root-based Category URLs
* Description: Enables root-based Category URLs, i.e. Makes /category/my-category/ URLs route as /my-category/
* Author: Mike Schinkel
* Author URI: http://about.me/mikeschinkel
* Plugin URI: https://gist.github.com/1421235
* Version: 0.1.1
* License: GPL 2+
*/
@kohske
kohske / gist:1150934
Created August 17, 2011 06:34
How to install development version of ggplot2
# install devtools
install.packages('devtools')
# install dependency of scales package
install.packages(c("RColorBrewer", "stringr", "dichromat", "munsell", "plyr", "colorspace"))
# load devtools
library(devtools)
# move to development mode