Skip to content

Instantly share code, notes, and snippets.

Avatar
🍕

Chad Lavimoniere chadlavi

🍕
View GitHub Profile
@alexjlockwood
alexjlockwood / print-unlinked-colors.ts
Created Feb 3, 2020
Prints nodes that have fill/stroke colors that aren't linked to a style.
View print-unlinked-colors.ts
figma.root.children
.flatMap(pageNode => pageNode.findAll(n => true))
.forEach(node => {
if ('fills' in node && 'fillStyleId' in node) {
if (node.fills !== figma.mixed && node.fills.length > 0 && node.fillStyleId !== '') {
print(`${node.name}'s fill color is not linked to a style`);
}
}
if ('strokes' in node && 'strokeStyleId' in node) {
if (node.strokes.length > 0 && node.strokeStyleId !== '') {
@alexjlockwood
alexjlockwood / generate-style-descriptions.ts
Last active Oct 2, 2021
Generates style descriptions for each color style in the current Figma file.
View generate-style-descriptions.ts
// Get the list of color styles in the current Figma file.
const colorStyles = figma.getLocalPaintStyles();
const updatedColorStyles = colorStyles.filter(style => {
const { paints } = style;
if (paints.length !== 1) {
// Skip styles containing multiple colors.
return false;
}
const [paint] = paints;
@chadlavi
chadlavi / fp6.user.js
Last active Jun 6, 2020
fp6 accessibility
View fp6.user.js
// ==UserScript==
// @name 6dot accessibility patch
// @version 4.0.6
// @namespace https://gist.github.com/chadlavi/1c57c8568a0ff295668b80a366f10a0d
// @author Chad Lavimoniere
// @grant none
// @include http*://6.*.org/*
// @downloadURL https://gist.github.com/chadlavi/1c57c8568a0ff295668b80a366f10a0d/raw/fp6.user.js
// @updateURL https://gist.github.com/chadlavi/1c57c8568a0ff295668b80a366f10a0d/raw/fp6.user.js
// ==/UserScript==
@chadlavi
chadlavi / youtube-embedder.user.js
Last active Oct 16, 2020
a js script to embed youtube videos when a youtube url is present
View youtube-embedder.user.js
// ==UserScript==
// @name youtube embedder
// @version 2.0.3
// @namespace https://gist.github.com/chadlavi/27c08ea6648d375c3f5de3ec7f43a015
// @downloadURL https://gist.github.com/chadlavi/27c08ea6648d375c3f5de3ec7f43a015/raw/youtube-embedder.user.js
// @updateURL https://gist.github.com/chadlavi/27c08ea6648d375c3f5de3ec7f43a015/raw/youtube-embedder.user.js
// @description embed youtube videos when a url is present
// @author Chad Lavimoniere
// @exclude http*://*youtube.com*
// @exclude http*://*facebook.com*
View Disable Device Enrollment Notification on Mac.md

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
View simple-https-server.py
#!/usr/bin/env python3
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import http.server
@jhermsmeier
jhermsmeier / README.md
Last active Apr 24, 2019
Oblique Strategies
View README.md

Oblique Strategies

Over One Hundred Worthwhile Dilemmas

Created by Brian Eno and Peter Schmidt and first published in 1975. Each card offers a challenging constraint intended to help artists (particularly musicians) break creative blocks by encouraging lateral thinking.

Wikipedia / Oblique Strategies

@boogah
boogah / ale.bash
Last active Mar 25, 2021
Never think about maintaining your homebrew install again with this shitty (but useful) shell script & cron job!
View ale.bash
#!/bin/bash
echo ""
echo "`date`: RUNNING: brew update"
/usr/local/bin/brew update
echo "`date`: FINISHED: brew update"
echo ""
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@pfig
pfig / mkfavicon.sh
Created Feb 12, 2012
Make a multi-resolution favicon.ico from a source image, using ImageMagick
View mkfavicon.sh
#!/bin/bash
# from
# http://bergamini.org/computers/creating-favicon.ico-icon-files-with-imagemagick-convert.html
convert source-WxW.png -resize 256x256 -transparent white favicon-256.png
convert favicon-256.png -resize 16x16 favicon-16.png
convert favicon-256.png -resize 32x32 favicon-32.png
convert favicon-256.png -resize 64x64 favicon-64.png
convert favicon-256.png -resize 128x128 favicon-128.png