Skip to content

Instantly share code, notes, and snippets.

@smholloway
smholloway / generate-alias-for-jekyll-post
Created Jan 31, 2014
Generate alias entries for Jekyll posts. This is
View generate-alias-for-jekyll-post
# Seth Holloway - https://github.com/smholloway
#
# The Jekyll Alias Generator, https://github.com/tsmango/jekyll_alias_generator,
# is a handy way to create meta refresh redirects from an old URL pattern to the
# new. This is helpful when changing blog formats as it helps maintain search
# engine rankings. Unfortunately, you have to create your own alias entries.
# With over 400 posts, I had # to automate it! This script will find all
# Markdown files in your _posts directory then generate an alias entry under the
# title attribute.
#
View pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9dyHjrrdDHBMNIUe+4HFDcVvR3FYLPCNjXmEDjGb28P4lQgRVKj5x29ao3BonE9PkPLz7KxULDIMQI7yg263SlbP1lXIuXsbHu+nEd9QZBlOwPTffWZHz547DqnOinFmxfZ/TJZhGNGqEd8DPm8uLP95Udn4XtEnrWRw/jxCdzROUA9JxqSNNyXp8OYH0L36tlHzWqHMLXh5H1dlcDsXQsO6xFA2sN0VQDHEo06z3YeOR8YmjLW3KK7D9ZkVis7+KcvfNAIJEq+QFLyCoUnyMuTOZ1tvDcAu23+Y7pUrqakUWlIYUlXNUmYI8A78SGQpBVKoIeFsStDwutDB+QXM3
View keybase.md

Keybase proof

I hereby claim:

  • I am smholloway on github.
  • I am sethholloway (https://keybase.io/sethholloway) on keybase.
  • I have a public key whose fingerprint is 3613 037C 0F80 E273 62F9 4E31 856E 6BAB B0CB A24D

To claim this, I am signing this object:

@smholloway
smholloway / check_for_yaml_vulnerability
Created Apr 17, 2014
Psych YAML vulnerability on Heroku
View check_for_yaml_vulnerability
# Built from https://gist.github.com/markpundsack/4506402
`heroku list`.split("\n").each do |app|
app = app.strip
# Some "heroku apps" lines have === formatting for grouping. They're not apps.
next if app[0..2] == "==="
# Some are appended by owner emails
app = app.split(" ")[0].to_s.strip
View toopher-get-pairing-status-json-response-example.js
{
"authenticator": {
"consumer": {
"key": "key"
},
"created": "2015-01-01 10:10:10",
"id": "12345678-1234-4123-8123-123456789abc",
"modified": "2015-01-01 10:10:10",
"name": "authenticator"
},
View toopher-pairing-json-response-example.js
{
"authenticator": {
"consumer": {
"key": "key"
},
"created": "2015-01-01 10:10:10",
"id": "12345678-1234-4123-8123-123456789abc",
"modified": "2015-01-01 10:10:10",
"name": "authenticator"
},
View toopher-python-pairing-example.py
import toopher
# Create an API object using your credentials
api = toopher.ToopherApi("<your consumer key>", "<your consumer secret>")
# Step 1 - Pair with their phone's Toopher app
pairing_status = api.pair("pairing phrase", "username@yourservice.com")
View toopher-authentication-json-response-example.js
{
"action": {
"created": "2015-01-01 10:10:10",
"id": "12345678-1234-4123-8123-1234567890ab",
"modified": "2015-01-01 10:10:10",
"name": "log in",
"requester": {
"consumer": {
"key": "key"
},
View toopher-php-pairing-example.php
require_once("toopher_api.php");
// Create an API object using your credentials
$toopherApi = new ToopherAPI($key, $secret);
// Step 1 - Pair with their phone's Toopher app
$pairing = $toopherApi->pair("pairing phrase", "username@yourservice.com");
View toopher-java-authentication-example.java
import com.toopher.*;
// Create an API object using your credentials
ToopherApi api = new ToopherApi("<your consumer key>", "<your consumer secret>");
// Step 2 - Authenticate a log in
AuthenticationStatus auth = api.authenticate(pairing.id, "my computer");
// Once they've responded you can then check the status
AuthenticationStatus status = api.getAuthenticationStatus(auth.id);