Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Typing...

Spencer Bliven sbliven

💻
Typing...
View GitHub Profile
@sbliven
sbliven / google-authenticator.rb
Last active Mar 8, 2019 — forked from Dan-Q/google-authenticator.rb
Command-line Google Authenticator (TOTP)
View google-authenticator.rb
#!/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 Nov 13, 2020 — forked from AmrEldib/404ForCaseSensitiveURLs.js
Jekyll 404 page on GitHub Pages to fix case sensitive URLs
View 404ForCaseSensitiveURLs.js
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);
You can’t perform that action at this time.