Skip to content

Instantly share code, notes, and snippets.

@nemzes
nemzes / gridlines.css
Created March 26, 2019 07:46
Gridlines background
body {
min-height: 100vh;
background-image:
linear-gradient(to right, #555, transparent 1px, transparent 9px),
linear-gradient(to bottom, #555, transparent 1px, transparent 9px),
linear-gradient(to right, #ccc, transparent 1px, transparent 9px),
linear-gradient(to bottom, #ccc, transparent 1px, transparent 9px);
background-repeat: repeat;
background-size:
100px 100px,
@nemzes
nemzes / trust-github.sh
Last active April 5, 2019 10:06
Trust GitHub public ket into .ssh/known_hosts
#!/bin/sh
# Adds the SSH public key for GitHub to the file defined in the KNOWN_HOSTS varible (below),
# provided that the key matches the publicy published key fingerprint from GitHub.
# Fingerprint can be fetched from https://help.github.com/articles/github-s-ssh-key-fingerprints/
# This should only ever change if GitHub's private keys are compromised and the keys are recreated.
SHA256_RSA_FINGERPRINT="SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8"
KNOWN_HOSTS=~/.ssh/known_hosts
@nemzes
nemzes / install.sh
Last active August 29, 2022 06:55
MacOS setup script
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew tap homebrew/cask
brew tap homebrew/cask-fonts
brew tap homebrew/cask-versions
brew install bettertouchtool coreutils discord-canary divvy docker firefox firefox-developer-edition font-fira-code gh git google-chrome google-chrome-canary google-drive httpie iterm2 itsycal jq keepassxc meld microsoft-teams node obsidian rowanj-gitx signal sound-control sqlite svgo tidal visual-studio-code
# Optionals
brew install azure-cli
@nemzes
nemzes / mapRouteParamsToProps.js
Created August 16, 2018 18:06
React and react-router: decouple route-based props from the match.params structure imposed by withRouter()
import React from 'react';
import { withRouter } from 'react-router';
/**
* Maps route parameters as defined in react-router and injects them as
* first-class props into a component. This avoids components being tightly
* coupled with the prop structure returned by withRouter()
*
* @example
* // Inject "family", "genus", and "species" in a URL like
.thing {
padding: 1rem;
border: 1px solid rebeccapurple;
position: relative;
width: 10rem;
}
.thing__link2 {
position: absolute;
right: 1rem;
@nemzes
nemzes / fluid-img.html
Created April 12, 2018 11:30
Fluid images with aspect ratio
<html>
<body>
<style>
.fluid-img {
width: 100%;
overflow: hidden;
position: relative;
outline: 1px solid rebeccapurple; /* remove */
@nemzes
nemzes / modernizr-flexbox-min-height-css.js
Last active April 4, 2018 12:17
Modernizr test for flexbox bug when using min-height
// Modernizr test for flexbox bug when using min-height
// See https://connect.microsoft.com/IE/feedback/details/802625/min-height-and-flexbox-flex-direction-column-dont-work-together-in-ie-10-11-preview
// This will then fix it in IE:
//
// .container {
// display: flex;
// flex-direction: column;
// min-height: 100vh;
// }
// .flexboxbug .container {
@nemzes
nemzes / gist:aa698acca35c8c235de2
Created September 18, 2014 06:47
Modernizr test for flexbox min-height bug (which exists in IE 11)
// Modernizr test for flexbox bug when using min-height
// See https://connect.microsoft.com/IE/feedback/details/802625/min-height-and-flexbox-flex-direction-column-dont-work-together-in-ie-10-11-preview
// This will then fix it in IE:
//
// .container {
// display: flex;
// flex-direction: column;
// min-height: 100vh;
// }
// .flexboxbug .container {