Skip to content

Instantly share code, notes, and snippets.

@larrybotha
larrybotha / A.markdown
Last active April 2, 2024 14:37
Export multiple artboards in Adobe Illustrator to png, or pdf

Export multiple Adobe Illustrator artboards to png, jpg, pdf

This is a reference to Matthew Ericson's article Export Illustrator Layers and/or Artboards as PNGs and PDFs in case something happens to happen to the article, and if I just forget where to find the exporter online.

Usage

  • Drop MultiExporter.js into /Applications/Adobe\ Illustrator\ CS6/Presets.localized/en_GB/Scripts
  • Restart Illustrator
@larrybotha
larrybotha / A.markdown
Last active February 7, 2024 15:20
Fix SVGs not scaling in IE9, IE10, and IE11

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

@larrybotha
larrybotha / A.markdown
Last active October 24, 2023 21:26
Merge wiki updates that are on a fork of your repo.

Merge Wiki Changes From A Forked Github Repo

This is inspired (or basically copied) from How To Merge Github Wiki Changes From One Repository To Another, by Roman Ivanov, and serves to ensure that should something happen to the original article, the information remains nice and safe here.

Terminology

OREPO: original repo - the repo created or maintained by the owner

FREPO: the forked repo that presumably has updates to its wiki, not yet on the OREPO

@larrybotha
larrybotha / A.markdown
Last active December 28, 2022 19:00
Monokai Sidebar Theme | Sublime Text

Sublime Text Monokai Sidebar Theme

A theme for the sidebar in Sublime Text to match the workspace of the Monokai theme.

This theme only modifies the sidebar to better match the Monokai theme, without modifying any of the styling elsewhere defined by Monokai.

File location: Packages/User

For a theme that extends beyond just the sidebar, visit https://gist.github.com/umpirsky/5842174

@larrybotha
larrybotha / readme.markdown
Last active October 27, 2021 04:28
Postfix Using Gmail SMTP in Mac OSX Mavericks
@larrybotha
larrybotha / A.markdown
Last active April 27, 2021 09:02
Mac OS Sierra MySQL my.conf

Fixing Mac OS Sierra MySQL Woes

MySQL throwing ERROR 2006 (HY000): MySQL server has gone away?

mysql -u root -p
# enter password

mysql > SET GLOBAL max_allowed_packet=1073741824;
@larrybotha
larrybotha / A.markdown
Last active March 3, 2021 10:41
Custom social sharing icons
@larrybotha
larrybotha / A.markdown
Last active December 26, 2019 23:07
XState + AWS Amplify example

XState + AWS Amplify example

A breakdown of a project that uses XState to manage state for authenticating a user with Cognito, and then finding the authorized application user with an invoked machine.

  1. create auth machine
  2. create auth context
  3. handle AWS authentication
  4. once user authenticates with Cognito, redirect to user route to get user from db
  5. at user route use userMachine service from authMachine to get application user
  6. once associated application user is found, send user to organization route to allow user to associate session with specific organization
@larrybotha
larrybotha / machine.js
Last active October 25, 2019 00:00
Generated by XState Viz: https://xstate.js.org/viz
// LunaMed organization authorisation
const fetchTargets = [{target: 'select', cond: 'hasOrgs'}, {target: 'fetching'}];
const xeroTokenExchangeTargets = [
{target: '#org.xeroSelect.exchangingToken', cond: 'hasOrgs'},
{target: 'fetchingOrgsForXeroTokenExchange'},
];
@larrybotha
larrybotha / machine.js
Created October 22, 2019 14:02
Generated by XState Viz: https://xstate.js.org/viz
// Luna Med user auth machine
const authUserMachine = Machine({
id: 'user',
initial: 'noUser',
context: {
error: undefined,
user: undefined,