Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sbliven's full-sized avatar
💻
Typing...

Spencer Bliven sbliven

💻
Typing...
View GitHub Profile
@sbliven
sbliven / google-authenticator.rb
Last active March 16, 2024 09:31 — forked from Dan-Q/google-authenticator.rb
Command-line Google Authenticator (TOTP)
#!/usr/bin/env ruby
# frozen_string_literal: true
# encoding: utf-8
#
# TOTP implementation (google authenticator)
#
# Reads ~/.google-authenticator-accounts for account info.
# For security, you should run `chmod 600 ~/.google-authenticator-accounts
#
# Changelog:
@sbliven
sbliven / 404ForCaseSensitiveURLs.js
Last active March 16, 2024 09:32 — forked from AmrEldib/404ForCaseSensitiveURLs.js
Jekyll 404 page on GitHub Pages to fix case sensitive URLs
var allposts = [];
function redirectToCorrectPage() {
console.log("Unable to find page. Trying other URL cases.");
{% for post in site.pages %}
allposts.push("{{ post.url }}");
{% endfor %}
var url = window.location.pathname;
// strip trailing /
if (url.slice(-1) === "/") {
url = url.slice(0, -1);