Skip to content

Instantly share code, notes, and snippets.

View equinusocio's full-sized avatar
:octocat:
Something went wrong. Try again🁢

Mattia Astorino equinusocio

:octocat:
Something went wrong. Try again🁢
View GitHub Profile
@JulianCataldo
JulianCataldo / .stylelintrc.cjs
Last active April 10, 2023 16:35
Astro tooling : Stylelint
/** @type {import("@types/stylelint").Options} */
module.exports = {
extends: [
'stylelint-config-standard',
'stylelint-config-standard-scss',
'stylelint-config-prettier',
],
overrides: [
{
@gavinmcfarland
gavinmcfarland / getLayerNames.js
Last active March 19, 2021 10:11
Get list of layer names in Figma
function getLayerNames() {
var names: any = []
var layers = figma.currentPage.selection
layers.map((layer) => {
names.push(layer.name)
})
return names
}
print(getLayerNames())
@jonathantneal
jonathantneal / README.md
Last active September 5, 2022 09:02
Create Fragment

Create Fragment

The createFragment function returns an HTML fragment from a string.

[
  { name: 'Hedral', coat: 'Tuxedo', legs: 4 },
  { name: 'Pillar', coat: 'Ticked Tabby', legs: 3 },
].reduce(
 (table, { name, coat, legs }) => {
@LasaleFamine
LasaleFamine / findFlatByKey.js
Created July 14, 2020 15:25
Find a couple of `key` - `value` within an object. Recursive.
const findFlatByKey = (choosenKey, choosenValue) => (ogg) => {
let found = false;
const step = (object, prev, currentDepth) => {
currentDepth = currentDepth || 1
Object.keys(object).forEach((key) => {
const value = object[key]
const isarray = Array.isArray(value)
const type = Object.prototype.toString.call(value)
const isobject = (
@simon04
simon04 / git.sh
Created January 14, 2020 07:16
Git merge/replace orphan branch into master
git checkout --orphan new-framework
# completely rewrite your application in new framework
git merge --strategy=ours --allow-unrelated-histories master
git commit-tree -p HEAD^2 -p HEAD^1 -m "Merge branch 'new-framework'" "HEAD^{tree}"
git reset --hard $OUTPUT_FROM_PREVIOUS_COMMAND
git checkout master
git merge --ff-only new-framework
@whour
whour / Sublime Text Licence Key Build 3156
Created December 12, 2017 02:49 — forked from dr3772/Sublime Text Licence Key Build 3156
Sublime Text Dev Build 3156 Serial Key
----- BEGIN LICENSE -----
eldon
Single User License
EA7E-1122628
C0360740 20724B8A 30420C09 6D7E046F
3F5D5FBB 17EF95DA 2BA7BB27 CCB14947
27A316BE 8BCF4BC0 252FB8FF FD97DF71
B11A1DA9 F7119CA0 31984BB9 7D71700C
2C728BF8 B952E5F5 B941FF64 6D7979DA
B8EB32F8 8D415F8E F16FE657 A35381CC
@LasaleFamine
LasaleFamine / postcss-build.js
Created December 4, 2017 15:16
Building postcss files.
const fs = require('fs-extra');
const postcss = require('postcss');
const postcssrc = require('postcss-load-config');
const folder = './folder/';
const outputFolder = './out';
const run = async () => {
const files = await fs.readdir(folder);
@paulirish
paulirish / what-forces-layout.md
Last active May 6, 2024 07:54
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active December 29, 2023 00:40
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@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