Skip to content

Instantly share code, notes, and snippets.

View MattCotterellNZ's full-sized avatar

Matt Cotterell MattCotterellNZ

  • Wellington, New Zealand
View GitHub Profile
@detroitenglish
detroitenglish / zxcvbn-haveibeenpwned-pw-check.js
Last active January 10, 2020 00:04
Fastify Handler: Password Scoring with zxcvbn + haveibeenpwned Range Query API
import zxcvbn from 'zxcvbn'
import axios from 'axios'
import crypto from 'crypto'
// Input is first validated via native Fastify JSON-schema declaration
export async function passwordStrengthChecker(req, reply) {
const { password } = req.body
let message, pwned, ok
let { score } = zxcvbn(password)
try {
@joepie91
joepie91 / genius-programmer.md
Last active June 25, 2023 08:46
The One Secret Trick To Becoming A Genius Programmer

The One Secret Trick To Becoming A Genius Programmer

Okay, the title of this post is a bit of a lie. There's no one secret trick to becoming a genius programmer - there are two, and they're more habits than tricks. Nevertheless, these kind of 'secret tricks' seem to resonate with people, so I went for this title anyway.

Every once in a while, a somewhat strange thing happens to me. I'll be helping somebody out on IRC - usually a beginner - answering a number of their questions in rapid succession, about a variety of topics. Then after a while, they call me a "genius" for being able to answer everything they're asking; either directly, or while talking about me to somebody else.

Now, I don't really agree with this "genius" characterization, and it can make me feel a bit awkward, but it shows that a lot of developers have a somewhat idealistic and nebulous notion of the "genius programmer" - the programmer that knows everything, who can do everything, who's never stumped by a problem, and of which ther

@peabnuts123
peabnuts123 / js--todo.css
Created October 31, 2017 01:39
Class for highlighting elements on a page as TODO without altering page structure
@keyframes seizure {
from {box-shadow: 0 0 0 4px #fd4b77,0 0 0 8px #fdf04b,0 0 0 12px #4bfdd0; }
20% {box-shadow: 0 0 0 4px #ffbd79,0 0 0 8px #fd4b77,0 0 0 12px #fdf04b; }
40% {box-shadow: 0 0 0 4px #514bfd,0 0 0 8px #ffbd79,0 0 0 12px #fd4b77; }
60% {box-shadow: 0 0 0 4px #f44bfd,0 0 0 8px #514bfd,0 0 0 12px #ffbd79; }
80% {box-shadow: 0 0 0 4px #4bfdd0,0 0 0 8px #f44bfd,0 0 0 12px #514bfd; }
to {box-shadow: 0 0 0 4px #fdf04b,0 0 0 8px #4bfdd0,0 0 0 12px #f44bfd; }
}
@keyframes throb {
[AttributeUsage(System.AttributeTargets.All, AllowMultiple = true, Inherited = true)]
public class ಠ_ಠAttribute : Attribute
{
public ILog Log { get; set; }
public ಠ_ಠAttribute()
{
Log.Info("This code is bad and you should feel bad");
}
}