Skip to content

Instantly share code, notes, and snippets.

View aspires's full-sized avatar
🍕
Probably eating pizza

Austin Spires aspires

🍕
Probably eating pizza
View GitHub Profile
@aspires
aspires / jameswhitemanifesto.txt
Created April 24, 2020 18:56 — forked from coliver/jameswhitemanifesto.txt
James White Manifesto
== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.
@aspires
aspires / fastly.rake
Last active August 29, 2015 14:06 — forked from jmoe/fastly.rake
namespace :fastly do
desc "set fastly cors headers to fix chrome/firefox font loading issues"
task allow_cors: :environment do
# check for the Cors Allow header
versions = Yajl.load(Excon.get("https://api.fastly.com/service/#{ENV['FASTLY_SERVICE_ID']}/version",
:headers => {'Fastly-Key'=>ENV['FASTLY_API_KEY']}).body)
last_version = versions.last['number']
@aspires
aspires / jpeg-to-webp.vcl
Last active September 30, 2016 21:16
JPEG to WebP
sub vcl_recv {
# Normalize Accept, we're only interested in webp right now.
# And only normalize for URLs we care about.
if (req.http.Accept && req.http.url ~ "(\.jpe?g|\.png)($|\?)") {
# So we don't have to keep using the above regex multiple times.
set req.http.X-Is-An-Image-URL = "yay";
# first let's see if it's unacceptable
if (req.http.Accept ~ "image/webp[^,];q=0(\.0?0?0?)?[^0-9]($|[,;])")
unset req.http.Accept;
@aspires
aspires / log-creation.sh
Created June 18, 2014 17:44
Logging Protips API cURL Sample
curl -X POST -H "Fastly-Key:yourkeyhere" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json" \
"https://api.fastly.com/service/SERVICE_ID/version/VERSION_NUMBER/syslog?name=test-syslog&address=example.com&format=%25h%20%25l%20%25u%20%25t%20%25r%20req.http.referrer"
@aspires
aspires / keybase.md
Last active August 29, 2015 13:57
keybase.md

Keybase proof

I hereby claim:

  • I am aspires on github.
  • I am aspires (https://keybase.io/aspires) on keybase.
  • I have a public key whose fingerprint is CA7B 4F0E 38CE B19E EC7B 970A F2A8 D54E A8CC DE74

To claim this, I am signing this object:

@aspires
aspires / benchmark.bash
Last active January 14, 2016 14:25
Fastly Benchmark Script
#!/bin/bash
# Dependencies: ApacheBench, MTR
REQUESTS=100
CONCURRENCY=10
FASTLY='www.example.com.global.prod.fastly.net'
CURRENT='www.example.com'
for url in 'path/to/test' 'path/to/test2' 'path/to/test3'; do
@aspires
aspires / gist:7860511
Created December 8, 2013 17:25
Not actually dangerous 😢
F
===============================================================================
Failure:
test_raw_client(FullLoginTest)
/Users/aspires/fastly-ruby/test/full_login_test.rb:26:in `test_raw_client'
23: user = @client.get('/current_user')
24: assert user
25: assert_equal @opts[:user], user['login']
=> 26: assert_equal @opts[:name], user['name']
27:
javascript:var els = Ext.select('a[class=lt-add-offer-link]').elements;for(var i in els){els[i].click()}

test

<html>
<head>
<title>Marquee Fishtank</title>
<style>
#fishtank {
width: 350px;
background-color: aqua;
}
#fish1 { color: red }
#fish2 { color: orange }