Skip to content

Instantly share code, notes, and snippets.

View PavelLaptev's full-sized avatar
📺
Long live the new flesh!

Pavel Laptev PavelLaptev

📺
Long live the new flesh!
View GitHub Profile
@yagudaev
yagudaev / setPropertyFill.test.ts
Created August 9, 2022 21:48
Figma convert `gradientHandlePositions` to `transformGradient` and vice-versa
import {
convertGradientHandlesToTransform,
convertTransformToGradientHandles
} from "./setPropertyFill"
describe("convertGradientHandlesToTransform", () => {
it("identity matrix", () => {
expect(
convertGradientHandlesToTransform([
{
@aleclarson
aleclarson / rollup-typescript.md
Last active May 6, 2024 19:37
The best Rollup config for TypeScript libraries

Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking
🧐 Source maps

Install

@ryohey
ryohey / detach.js
Last active March 11, 2021 21:16
Detach and flatten all frames in Figma
const detachAndFlatten = (pageName) => {
const detach = (c) => figma.union([c], c.parent)
const page = figma.root.children.find(c => c.name === pageName)
const frames = page.children.filter(c => c.type === "FRAME")
for (let frame of frames) {
for (let c of frame.children) {
if (c.type === "INSTANCE") {
c = detach(c)
} else {
@robertvanhoesel
robertvanhoesel / designComponentsDropdown.tsx
Created August 27, 2018 17:07
Retrieve all Design Components in a Framer X document
import * as React from "react";
import { PropertyControls, ControlType } from "framer";
// Step 1: Import all exported values and put them on designComponents variable
import * as designComponents from "./canvas";
// Step 2. Filter out the functions only (skip the __info__ variable)
// In the future this might need better typechecking might canvas.ts change
const components = Object.keys(designComponents).filter(
k => typeof designComponents[k] == "function"
@jimmywarting
jimmywarting / readme.md
Last active June 18, 2024 16:00
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@mritzco
mritzco / install.md
Last active September 2, 2022 00:11
Running AR.js sample locally
@vanquang9387
vanquang9387 / japanese-font-family.md
Created March 16, 2017 01:48
Japanese default css font family

Most Japanese websites use default font sets provided on Windows or Mac. The latest ones are Meiryo and Hiragino Kaku Gothic Pro. For older versions such like Windows XP, it is good to add former default fonts MS Gothic(or MS Mincho)/Osaka.

Some old browsers could not understand those font names in English, some others do not recognize the names in Japanese, so it is safe to write both in Japanese and English.

Meiryo and Hiragino's order is, because Mac users may have Meiryo from MS-Office, and Hiragino is more familiar and matching well on Mac, better by starting Hiragino series.

So the current recommended practice is like this,

font-family:"ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro",Osaka, "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", sans-serif;
@jeromeetienne
jeromeetienne / .block
Last active July 23, 2021 17:36
AR.js with a-frame - Augmented Reality in less than 10lines of html
license: mit
@juhaelee
juhaelee / react-typescript.md
Last active May 28, 2024 17:41
React + Typescript Cheatsheet

React + Typescript Cheatsheet

Setup

If you use atom... download & install the following packages:

What are Typescript type definition files? (*.d.ts)

@pketh
pketh / 1-promises.coffee
Last active April 5, 2023 02:12
Promises in Coffeescript
# Create a promise:
myCoolPromise = new Promise (resolve, reject) ->
# do a thing
success = true
if success
resolve 'stuff worked'
else
reject Error 'it broke'