Skip to content

Instantly share code, notes, and snippets.

@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>
@geoffyuen
geoffyuen / retroarch.md
Last active May 6, 2020 15:57
Retroarch Tips and Tricks

Retroarch Tips and Tricks

Notes on Retroarch from a Fire TV Stick 4K user. A lot of information here will also be applicable to any platform.

Delete a core

Load the core, then go to information > core information > delete core.

PCSX Rearmed

@geoffyuen
geoffyuen / firestick4k.md
Last active July 5, 2025 08:28
Amazon Fire Stick 4k Tips and Tricks
@geoffyuen
geoffyuen / twig.md
Last active October 10, 2019 14:45
Twig Tips and Tricks

Twig Tips and Tricks

Output tricks

Echo variables and math

{% set name = 'Hello Buddy' %}
{{ "Hi #{name}, how are you today" }}
@geoffyuen
geoffyuen / _svg_bg.scss
Created April 22, 2019 18:10
Inline svg as css background
$svg: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">';
$path_attr: 'fill="transparent" stroke="%23bada55" stroke-width="4" stroke-linecap="round"';
.bg_close {
background: url($svg + '<polyline points="4,4 46,46" ' + $path_attr + '/><polyline points="46,4 4,46" ' + $path_attr + '/></svg>') no-repeat 0 0;
background-size: 100% 100%;
}
.bg_left {
background: url($svg + '<polyline points="36,4 14,25 36,46" ' + $path_attr + '/></svg>') no-repeat 0 0;
background-size: 100% 100%;
}
@geoffyuen
geoffyuen / higan.md
Created April 18, 2019 15:20
Compile Higan for MacOS
  1. Install Xcode. Run it at least once and jump through all the dialogs.
  2. Install the Xcode commandline tools. Open the terminal.app, type xcode-select --install.
  3. Download the Higan source and unzip.
  4. In terminal, navigate to the higan subfolder
  5. Type make and wait for it to be built. Once finished it will be in the higan/out folder.
  6. Do the same for the Icarus folder
@geoffyuen
geoffyuen / menu.sh
Last active March 6, 2019 05:01
ia-rcade helper scripts
#!/bin/bash
# echo fullnames of roms in ./roms and lets you run
clear
echo -n "Loading"
list=()
roms=()
PS3="Type a number or ctrl-c to quit: "
for filename in roms/*.zip
do
rom=$(grep -i "^$(basename "$filename" .zip) " listfull.txt)
@geoffyuen
geoffyuen / woo_handy.md
Last active June 3, 2019 14:11
Handy WooCommerce

Handy WooCommerce

Taxes

Free USA Tax Tables from Avalara

Needs email address

@geoffyuen
geoffyuen / timber.md
Last active February 23, 2021 04:32
Timber Cheatsheet

Timber Cheatsheet

Srcset images

<img src="{{ fn('wp_get_attachment_image_url', post.thumbnail.id, 'medium') }}" 
  srcset="{{ fn('wp_get_attachment_image_srcset', post.thumbnail.id, 'medium' ) }}"
  sizes="(max-width: 1024px) 100vw, 1024px" 
  alt="Post thumbnail">