Skip to content

Instantly share code, notes, and snippets.

View tsdorsey's full-sized avatar

Trevor Dorsey tsdorsey

View GitHub Profile
@tsdorsey
tsdorsey / index.html
Last active February 4, 2022 21:29
Demonstration of CSS keyframe bug in Safari Safari 15.4
<html lang="en">
<head>
<style>
.rotate {
animation: rotate 0.75s linear infinite;
transform-origin: center center;
}
@keyframes rotate {
/* Uncomment the following line and the <circle> will spin as expected. */
/* 99% {} */
@tsdorsey
tsdorsey / groupedHandler.js
Created February 26, 2018 22:21
Stopgap for the 200 resource limit in AWS by compressing the endpoint count
export function buildResponse(statusCode, body, cors = true) {
const result = {
statusCode: statusCode || HTTP_STATUS.OK,
};
if (cors) {
result['headers'] = {
'Access-Control-Allow-Origin': '*',
Accept: 'application/json',
};
@tsdorsey
tsdorsey / http_status_codes.js
Last active August 25, 2017 05:22 — forked from joseluisq/status_codes.js
HTTP Status codes
// https://github.com/nodejs/io.js/blob/8be6060020cd2f18ec6c1a5c3a40eb07b8d0e455/lib/_http_server.js#L18
var HTTP_STATUS_CODE = {
100 : 'Continue',
101 : 'Switching Protocols',
102 : 'Processing', // RFC 2518, obsoleted by RFC 4918
200 : 'OK',
201 : 'Created',
202 : 'Accepted',
203 : 'Non-Authoritative Information',
@tsdorsey
tsdorsey / hmac-sha-1.rb
Last active December 3, 2015 22:33
Ruby version of .NET membership password hashing
require 'base64'
require 'openssl'
require 'securerandom'
# Creates and interprets .NET RFC2898 version 0 encoded passwords.
# Password format is Base64.strict_encode64(\0x0 + salt + subkey)
def encode(str)
Base64.strict_encode64(str)
end