Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View thechriswalker's full-sized avatar
🤜
🤛

Chris Walker thechriswalker

🤜
🤛
View GitHub Profile
@thechriswalker
thechriswalker / extra-hard-wordle.js
Created February 7, 2022 13:30
Wordle Extra Hard Mode
// Turn into a bookmarklet, or user-script or paste into your console.
if (!wordle.extraHardMode) {
wordle.extraHardMode = true;
// toggle hardMode
const state = JSON.parse(localStorage.gameState);
state.hardMode = true;
localStorage.gameState = JSON.stringify(state);
const originalEvaluateRow = wordle.bundle.GameApp.prototype.evaluateRow;
wordle.bundle.GameApp.prototype.evaluateRow = function extraHardMode() {
{
async function hmac_sha256(key, str) {
// encode the string key as bytes using UTF8 encoding.
const keyBytes = new TextEncoder().encode(key);
// generate a key for use in signing with HMAC-SHA256
const secretKey = await crypto.subtle.importKey(
"raw", keyBytes,
{ name: "HMAC", hash: "SHA-256" },
false, ['sign']
);
@thechriswalker
thechriswalker / setup-ts-project-references-for-yarn-workspaces.js
Created February 4, 2020 15:50
Use yarn workspace info to create TS project references.
const { execSync } = require('child_process');
const { readFileSync, writeFileSync } = require('fs');
const { relative } = require('path');
const utf8 = { encoding: 'utf8' };
function writeJson(path, content) {
writeFileSync(path, JSON.stringify(content, null, 2) + '\n', utf8);
}
function readJson(path) {

Keybase proof

I hereby claim:

  • I am thechriswalker on github.
  • I am thechriswalker (https://keybase.io/thechriswalker) on keybase.
  • I have a public key ASDIrrfPfTBrckyfliYxYnZ1FuzmlJGvUu42P-mrtAKWvQo

To claim this, I am signing this object:

@thechriswalker
thechriswalker / enforce_utc.go
Last active June 7, 2017 12:58
higher order formatter/hook to enforce UTC times
package log
import (
log "github.com/sirupsen/logrus"
)
/**
* You can enforce UTC on a single formatter with this wrapper
*/
func EnforceUTC(f log.Formatter) log.Formatter {
@thechriswalker
thechriswalker / browse.tpl
Last active September 21, 2020 07:51
Caddy Browse Template compatible with KODI
<!DOCTYPE html>
<html>
<head> <title>{{html .Name}}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* { padding: 0; margin: 0; }
body {
font-family: sans-serif;
@thechriswalker
thechriswalker / cors.conf
Created July 11, 2014 10:11
CORS on NGINX just GET
# Should have forked https://gist.github.com/michiel/1064640, but hey
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;