Skip to content

Instantly share code, notes, and snippets.

View mvsde's full-sized avatar
🏳️‍⚧️
Protect trans kids!

Fynn Becker mvsde

🏳️‍⚧️
Protect trans kids!
View GitHub Profile
@mvsde
mvsde / focus-visible.css
Last active August 27, 2020 08:14
CSS niceties
/* https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */
:focus:not(:focus-visible) {
outline: 0;
}
@mvsde
mvsde / consumer.js
Last active August 20, 2020 06:19
Basic reactive store with Vue 3: https://v3.vuejs.org/api/basic-reactivity.html
import store from './store.js'
console.log(store.state.hello) // '🌍'
store.greet('🌌')
console.log(store.state.hello) // '🌌'
console.log(store.state.cool) // Set('🍍')
store.addCool('🍌')
console.log(store.state.cool) // Set('🍍', '🍌')
@mvsde
mvsde / markup.html
Last active September 23, 2019 09:54
Simple color theme system with Dart Sass
<div class="is-primary">
<button class="button">I'm primary</button>
</div>
<div class="is-secondary">
<button class="button">I'm secondary</button>
</div>
@mvsde
mvsde / parseISODate.js
Last active September 2, 2019 09:52
`new Date()` that works in Safari
/**
* Parse ISO date string
*
* This convoluted mess is necessary because lovely Safari doesn't use the
* local time zone during `new Date(…)`!
* @param {'YYYY-MM-DD'} date Date string
* @param {'HH:MM:SS'} time Time string
* @returns {Date} Parsed date
*/
export default function (date, time) {
@mvsde
mvsde / get-data-type.js
Created June 12, 2019 05:19
Get JavaScript data type
/**
* Get data type
* @see {@link https://gomakethings.com/a-better-way-to-create-an-immutable-copy-of-an-array-or-object-with-vanilla-js/}
*
* @param {} item Thing we want the type of
* @returns {String} Thing's type
*/
function getDataType (item) {
/**
* Unfortunately, `typeof` isn't that useful to detect types like `array`
@mvsde
mvsde / json-stringify.scss
Last active August 26, 2019 12:58
Naive JSON.stringify() in Sass (handles strings only)
@function json-stringify ($map) {
$result: '{';
@each $key, $value in $map {
$result: $result + '"#{$key}":';
@if type-of($value) == 'map' {
$result: $result + json-stringify($value);
} @else {
$result: $result + '"#{$value}"';
@mvsde
mvsde / script.sh
Created February 21, 2019 12:12
Re-enable macOS subpixel antialiasing
defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
@mvsde
mvsde / mirror-website.sh
Last active January 13, 2019 10:14
Download mirror of a website
wget --mirror --page-requisites --adjust-extension --convert-links --no-clobber --domains=domain.tld https://domain.tld
@mvsde
mvsde / android-volume-steps.md
Last active April 14, 2024 00:04
Android Volume Steps

Android Volume Steps

Warning

This is a rather old guide and may or may not work with modern versions of Android.

Connect through ADB

  1. Boot into TWRP
  2. Connect device to computer
  3. Terminal: List devices with adb devices
@mvsde
mvsde / disable-auto-restart.sh
Last active August 20, 2018 05:11
Stop Docker auto restart on all containers
# Source:
# https://github.com/moby/moby/issues/10032#issuecomment-310023443
docker stop $(docker ps -a -q) & docker update --restart=no $(docker ps -a -q)