Skip to content

Instantly share code, notes, and snippets.

@teetow
teetow / focusdebug.md
Created May 18, 2021 11:49
The CSS keyboard focus highlighter

The Focus Debugger

TL;DR: This chunk of code will add a little tooltip to the currently focused element, telling you which classes it has so you can identify it.

let style = `:focus::after {
  background-color: #333;
  color: white;
  content: 'has focus: ' attr(class);
 font-family: monospace;
@jamesmacfie
jamesmacfie / README.md
Created October 22, 2019 02:53
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@stongo
stongo / app.js
Last active January 23, 2024 18:48
Joi validation in a Mongoose model
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', function() {
return console.error.bind(console, 'connection error: ');
});
<?php
$DEBUGGING = True;
$TRACECOUNT = 0;
if($DEBUGGING)
{
error_reporting(E_ALL);
ini_set('display_errors', True);
)