Skip to content

Instantly share code, notes, and snippets.

@geoffyuen
geoffyuen / mames.sh
Created April 1, 2021 17:30
dumb ia-rcade menu for bash
mames(){
ls -l ~/mame/roms
local IFS=$'\n'
echo "Search for: "
read inp
echo .
local PS3="Type a number: "
select file in $(mame -listfull|grep -i "$inp")
do
# get first word from selected string/line using awk
@geoffyuen
geoffyuen / impose_pdf.md
Last active March 28, 2021 17:35
Impose a pdf for free

Debian:

sudo apt install texlive-latex-base
sudo apt install texlive-extra-utils

MacOS Homebrew (untested):

@geoffyuen
geoffyuen / input.scss
Created January 28, 2021 04:48
Generated by SassMeister.com.
@function cfg($key, $map: $cfg) {
@return map-get($map, $key);
}
$tach:(
values: (
0: 0,
1: 1px,
2: 2px,
),
rules: (
@geoffyuen
geoffyuen / input.scss
Last active January 25, 2021 04:39
Tailwind/Tachyons genrerator in pure Sass.
@function cfg($key, $map: $cfg) {
@return map-get($map, $key);
}
$cfg: (
whitespace: (
values: (
0: 0,
1: 1px,
@geoffyuen
geoffyuen / noJQuery.md
Last active April 6, 2020 18:54
No JQuery

Vue or Vanilla replacements for JQuery plugins

Old Replacement
$.animate Velocity.js
slick.js
@geoffyuen
geoffyuen / SassMeister-input.scss
Last active December 13, 2019 15:41
Sass/css - width from browser edge to grid system column
// Calculates the width of something that hugs the browser edge
// to a column inside a grid system with a max-width (Tachyons)
.sideimg {
$mw: 1920px; // max-width of container
$col: 40; // tach col width in percentage
// this doesn't evaluate
width: calc( 50% + ( -$mw / 2 + $mw * $col/100 ) );
@geoffyuen
geoffyuen / _webp.twig
Last active May 12, 2020 12:36
Webp with fallback for Timber/Twig
{% spaceless %}
{#
This Timber twig will output an <picture> with fallbacks, srcset x2, alt, width and height
Usage:
`{% include '_webp.twig' with { class: "db ma0 center w-100", img: Image(post.acf_image), w: 507, h: 507 } %}`
@params
@geoffyuen
geoffyuen / _img.twig
Last active November 18, 2019 20:03
Image twig with resize and srcset
{% spaceless %}
{#
This Timber twig will output an <img> with srcset x2, alt, width and height
Usage:
`{% include '_img.twig' with { class: "db ma0 center w-100", img: Image(post.acf_image), w: 507, h: 507 } %}`
@params
@geoffyuen
geoffyuen / svg.md
Last active July 25, 2020 16:53
SVG Cheatsheet

SVG Cheatsheet

Rectangle

<svg viewBox="0 0 220 100" xmlns="http://www.w3.org/2000/svg">
  <!-- Rounded corner rectangle -->
  <rect x="120" width="100" height="100" rx="15" />
</svg>