This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ModularScale = require('modularscale-js'); | |
module.exports = function ms({ addUtilities, config, e }) { | |
const values = config('theme.ms', { | |
sizes: [ | |
{ size: 'sm', value: -1 }, | |
{ size: 'base', value: 0 }, | |
{ size: 'lg', value: 1 }, | |
{ size: 'xl', value: 2 }, | |
{ size: '2xl', value: 3 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Adaptive Text Color Function | |
* | |
* Example: | |
* .text-contrast { | |
* color: adaptive-text-color(#fff); | |
* } | |
* | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Color = require('color'); | |
// get the nearest color/s for tailwindcss | |
// | |
// install: | |
// npm install gist:33df8e232bf36e422e3abf3566a59ee0 --save | |
// or | |
// yarn add gist:33df8e232bf36e422e3abf3566a59ee0 | |
// | |
// tailwind.config.js example: | |
// extend: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Demo: | |
// https://codepen.io/mpalpha/pen/bGNmpxB | |
// Dependencies: | |
// https://cdnjs.cloudflare.com/ajax/libs/gsap/3.0.5/gsap.min.js | |
// https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/ScrollMagic.min.js | |
// https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/animation.gsap.min.js | |
// https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/debug.addIndicators.min.js | |
// https://cdnjs.cloudflare.com/ajax/libs/smooth-scroll/16.1.0/smooth-scroll.min.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Storybook menu sort utility | |
* Allows you to sort storybook stories by an external array of strings. | |
* | |
* install: | |
npm install gist:0cdded150eb533938b502cc958ee529a --save | |
* | |
* | |
* example storybook config.js: | |
import storySorter from 'story-sorter'; | |
addParameters({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* "addParameters" in config.js | |
* | |
* addParameters({ | |
* options: { | |
* storySort: sortByArray, | |
* } | |
* }); | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// application init | |
const appInit = () => new App(); | |
// story init | |
const storyInit = () => {}; | |
// story load | |
const storyLoad = () => new App(); | |
// Init handler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fix ubuntu 18.x+ SDL issue for retropie. | |
RETROPIECFG=/opt/retropie/configs/all/retropie.cfg | |
if [ ! -f $RETROPIECFG ]; then | |
sudo sed --in-place 's/2.0.8/2.0.9/g' $HOME/Retropie-Setup/scriptmodules/supplementary/sdl2.sh | |
mkdir -R /opt/retropie/configs/all/ | |
echo "own_sdl2=\"0"\" >> /opt/retropie/configs/all/retropie.cfg | |
sudo rm /usr/share/doc/libsdl2-2.0-0/copyright | |
sudo apt remove libsdl2-dev | |
sudo apt --fix-broken install | |
sudo apt autoremove |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/pulseaudio -nF | |
# | |
# check if you are missing pavucontrol. run "which pavucontrol" | |
# If so, install it and Download a working Atomic Pi HDMI audio configuration file. | |
# run "sudo apt install -y pavucontrol && sudo curl -o /etc/pulse/default.pa -L https://gist.githubusercontent.com/mpalpha/5e0d87f514bca0f87769864655300c99/raw" | |
# | |
# This file is part of PulseAudio. | |
# | |
# PulseAudio is free software; you can redistribute it and/or modify it | |
# under the terms of the GNU Lesser General Public License as published by |