Skip to content

Instantly share code, notes, and snippets.

View maxboeck's full-sized avatar

Max Böck maxboeck

View GitHub Profile
@maxboeck
maxboeck / keybase.md
Last active August 28, 2017 09:23
Slef-Verification for Keybase.io

Keybase proof

I hereby claim:

  • I am maxboeck on github.
  • I am mxb (https://keybase.io/mxb) on keybase.
  • I have a public key whose fingerprint is 2D6B F9EA CA44 6DD6 4A4E 83FF 944E 076E 5FC2 7685

To claim this, I am signing this object:

@maxboeck
maxboeck / LetItSnow
Created December 19, 2014 16:30
Festive fun for your terminal!
ruby -e 'C=`stty size`.scan(/\d+/)[1].to_i;S=["2743".to_i(16)].pack("U*");a={};puts "\033[2J";loop{a[rand(C)]=0;a.each{|x,o|;a[x]+=1;print "\033[#{o};#{x}H \033[#{a[x]};#{x}H#{S} \033[0;0H"};$stdout.flush;sleep 0.1}'
@maxboeck
maxboeck / settings.json
Created May 3, 2017 15:26
VScode settings
// Place your settings in this file to overwrite the default settings
{
"editor.fontSize": 16,
"editor.tabSize": 2,
"editor.lineHeight": 28,
"editor.formatOnPaste": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
@maxboeck
maxboeck / focustrap.js
Last active February 15, 2018 10:11
Reusable Focus Trap Example
// Reusable Focus Trap Method
export function createFocusTrap(el, opt = {}) {
let isActive = false
const focusableElementSelectors = [
'a[href]',
'area[href]',
'input:not([disabled])',
'select:not([disabled])',
'textarea:not([disabled])',
{
"Create a stateless React component": {
"prefix": "scomp",
"description": "A stateless component",
"body": [
"import React from 'react'",
"import PropTypes from 'prop-types'",
"\nconst $1 = props => {",
"\treturn (",
"\t\t$0",
@maxboeck
maxboeck / cardlist.html
Last active February 24, 2019 19:13
linked card pattern
<ul>
<li class="card">
<a href="/foo" class="card__link">
<p class="card__title">The Card Title</p>
<img class="card__image" src="/some/image.jpg" alt="">
<small class="card__meta">Some category</small>
<p class="card_summary">Lorem ipsum, dolor sit amet!</p>
</a>
</li>
@maxboeck
maxboeck / array_from_mapping.js
Last active April 2, 2019 13:32
Array.from mapping function
const allButtons = document.querySelectorAll('button');
const init = btn => {
btn.classList.add('is-initialized');
btn.addEventListener('click', () => console.log(btn, 'clicked'));
return btn;
}
Array.from(allButtons, init);
@maxboeck
maxboeck / selection.css
Created April 17, 2019 15:26
Custom Selection Color
/* Custom Selection Color */
::selection {
background: #d81e05;
color: #ffffff;
}
::-moz-selection {
background: #d81e05;
color: #ffffff;
@maxboeck
maxboeck / donottrack.js
Last active November 6, 2023 10:00
Check "Do Not Track" Client Hint
const allowsTracking = () => {
const dnt =
window.doNotTrack ||
navigator.doNotTrack ||
navigator.msDoNotTrack
if (dnt === 1 || dnt === '1' || dnt === 'yes') {
return false
}
if ('msTrackingProtectionEnabled' in window.external) {
return !window.external.msTrackingProtectionEnabled()
@maxboeck
maxboeck / git-append-issue
Created May 15, 2019 09:30
Custom git command to append an issue number to the last commit message.
#!/bin/sh
OLD_MSG=$(git log --format=%B -n1)
git commit --amend -m "$OLD_MSG, #$1"