-
Open the Figma desktop app
-
Go to Plugins > Development > New Plugin > Figma Design > Run Once
This creates a plugin with starter source code to drop five orange rectangles on the canvas -
Setup the plugin:
cd <project-dir>
type Handlers = Record<string, (...args: any) => void> | |
const isPlugin = typeof figma !== 'undefined' | |
const res: Record<number, (t: any) => void> = {} | |
export function handlers<T extends Handlers>(methods: T): T { | |
const t = isPlugin ? figma.ui : window | |
t.onmessage = async (m: any) => { | |
const { method, args } = m.data ? m.data.pluginMessage.pluginMessage : m |
let angle = 45 | |
let theta = angle * (Math.PI/180) //radians | |
let sel = figma.currentPage.selection[0] | |
//cx,cy is the center of the node | |
let cx = sel.x + sel.width/2 | |
let cy = sel.y + sel.height/2 | |
let newx = Math.cos(theta) * sel.x + sel.y * Math.sin(theta) - cy * Math.sin(theta) - cx * Math.cos(theta) + cx | |
let newy = - Math.sin(theta) * sel.x + cx * Math.sin(theta) + sel.y * Math.cos(theta) - cy * Math.cos(theta) + cy |
global.THREE = require("three"); | |
const canvasSketch = require('canvas-sketch'); | |
const Random = require('canvas-sketch-util/random'); | |
const gradientHeight = 512; | |
const settings = { | |
dimensions: [ 2048, gradientHeight * 2 ] | |
}; |
The helper function canvas-to-svg.js
wraps a given render function (or renderer object) so that you can use Canvas2D context methods as usual, but upon single frame export (with Cmd/Ctrl + S) it will produce both a PNG and SVG file.
This uses canvas2svg which is not a perfect solution, as the Canvas2D API was never designed to be translated to SVG. Its best to stick with simple shape and path operations.
Full instructions: first install the canvas-sketch CLI if you haven't already:
npm install canvas-sketch-cli -g
This is a post to satisfy your curiosity about alternative keyboard layouts, why some people use them, and whether they're for you. It is intended to discuss the topic in broad terms, but I will share my personal preferences towards the end. Due to time constraints and my own limited knowledge, I will focus on layouts optimized for the English language (ANSI variants, with an occasional nod to ISO).
First off, it's important to understand how much debate there is about how we got here: I will not even attempt to settle the issue of who invented the 'first' typewriter layout, because the modern device had many predecessors going back centuries. The usual legend of typewriter evolution holds that American Christopher Latham Sholes debuted the typewriter in 1868 with a 2-row layout that was (nearly) alphabetical. A horizontal stagger between the rows made room for the lever arms attached to each key:
3 5 7 9 N O P Q R S T U V W X Y Z
2 4 6 8 . A B C D E
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk | |
index 18f8b0bbfc..4ef3e230e4 100644 | |
--- a/builddefs/common_features.mk | |
+++ b/builddefs/common_features.mk | |
@@ -878,6 +878,10 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes) | |
endif | |
endif | |
+ifeq ($(strip $(APPLE_FN_ENABLE)), yes) | |
+ OPT_DEFS += -DAPPLE_FN_ENABLE |
.cursor { | |
cursor: url("cursor.png") 0 0, pointer; /* Legacy */ | |
cursor: url("cursor.svg") 0 0, pointer; /* FF */ | |
cursor: -webkit-image-set(url("cursor.png") 1x, url("[email protected]") 2x) 0 0, pointer; /* Webkit */ | |
} |
// NOTICE 2020-04-18 | |
// Please see the comments below about why this is not a great PRNG. | |
// Read summary by @bryc here: | |
// https://github.com/bryc/code/blob/master/jshash/PRNGs.md | |
// Have a look at js-arbit which uses Alea: | |
// https://github.com/blixt/js-arbit | |
/** |