This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.describe Data do | |
subject { data.new(**input) } | |
let(:data) { Data.define(:a, :b) } | |
context "when providing all arguments" do | |
context "with string keys" do | |
let(:input) { { "a" => 1, "b" => true } } | |
it { is_expected.to have_attributes(a: 1, b: true) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run with jest | |
const succ = function * (string) { | |
const matchResult = string.match(/^([a-z]*)([a-z])$/); | |
if (matchResult) { | |
const prefix = matchResult[1]; | |
const last_char = matchResult[2]; | |
if (last_char == 'z') { | |
yield arguments.callee(prefix).next().value + 'a'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# This helps suggest words for Blossom | |
# https://www.merriam-webster.com/games/blossom-word-game | |
# | |
# The script takes 2 arguments: a string of "petal" letters, and the center letter. | |
# | |
# For example, if the petals are N E O L A T and the the center is P, run: | |
# | |
# ./blossom-cheat.rb neolat p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Twitter Extras | |
// @description Tweaks for Twitter Dot Com | |
// @include /^https://twitter.com/ | |
// @run-at document-idle | |
// ==/UserScript== | |
if (document.querySelector('head meta[property="og:type"][content="profile"]')) { | |
let url = new URL(document.querySelector('head meta[property="og:url"]').content); | |
let username = url.pathname.replace(/^\//, ""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
"use strict"; | |
const repl = require('node:repl'); | |
const util = require('node:util'); | |
const octordle_dictionary = [ | |
"aahed", | |
"aalii", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wordle 589 3/6 | |
⬜⬜⬜⬜🟨 | |
🟨🟨⬜⬜⬜ | |
🟩🟩🟩🟩🟩 | |
Wordle 588 4/6 | |
⬜⬜⬜⬜⬜ | |
🟨🟨⬜⬜🟨 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Bandcamp Collection Extras | |
// @description Adds extras to Bandcamp collection pages | |
// @grant unsafeWindow | |
// @match https://bandcamp.com/* | |
// @run-at document-idle | |
// @version 1.0.0 | |
// ==/UserScript== | |
class BandCampCollection { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# loser: a socat-based web server | |
log() { | |
>&2 echo $* | |
} | |
print_http_response() { | |
printf "HTTP/1.0 $1\r\n" | |
printf "Content-type: $2; charset=utf-8\r\n\r\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name FindAGrave Extras | |
// @description Adds links to FindAGrave pages | |
// @include /^https://www.findagrave.com/memorial/[0-9]+// | |
// @run-at document-idle | |
// ==/UserScript== | |
class FindAGraveMemorial { | |
constructor(fg, doc) { | |
try { this.findagrave = fg() } catch(e) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Discogs Extras | |
// @description Adds search links to Discogs pages and more | |
// @include https://www.discogs.com/* | |
// ==/UserScript== | |
class SearchSite { | |
constructor(doc) { | |
this.doc = doc; | |
} |
NewerOlder