This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Trying to debug why this is slow | |
# root rule | |
root ::= jsxElement | |
# Main JSX Element | |
jsxElement ::= | |
"<" jsxElementName jsxAttributesOpt ">" jsxChildrenOpt "</" jsxElementName ">" | |
# JSX Self-Closing Element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable @typescript-eslint/no-var-requires */ | |
const { ReplaceSource } = require("webpack-sources") | |
/// This is a workaround for a bug in Figma plugins where they don't like the text "import(" | |
class FigmaWorkaroundPlugin { | |
// based on BannerPlugin https://github.com/webpack/webpack/blob/05ebf5bba670152101d1cc0f42f165b9fd295164/lib/BannerPlugin.js | |
process(file) { | |
if (file.source().includes("import(")) { | |
const replace = new ReplaceSource(file, "fix import( in Figma plugins FigmaWorkaroundPlugin") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Type 'Interpolation<[pan: number, tilt: number], [x: number, y: number, z: number, order?: string | undefined]>' is not assignable to type '[x: number, y: number, z: number, order?: string | undefined] | { x: number | FluidValue<number, any>; y: number | FluidValue<number, any>; z: number | FluidValue<number, any>; ... 14 more ...; _onChange: {}; } | [x: ...] | undefined'. | |
Type 'Interpolation<[pan: number, tilt: number], [x: number, y: number, z: number, order?: string | undefined]>' is not assignable to type '[x: number | FluidValue<number, any>, y: number | FluidValue<number, any>, z: number | FluidValue<number, any>, order?: string | FluidValue<string, any> | undefined]'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const colors = figma.getLocalPaintStyles() | |
.map(c => { | |
const {name, paints} = c | |
const paint = paints[0] | |
if (isSolidPaint(paint)) { | |
const {opacity, color} = paint | |
const {r,g,b} = color | |
return {name, color: {red: r, green: g, blue: b, alpha: opacity} } | |
} else { | |
return undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LocklessQueue.swift | |
// Famera | |
// | |
// Created by Andrew Pouliot on 11/11/20. | |
// Copyright © 2020 Famera. All rights reserved. | |
// | |
import Foundation | |
import CoreMedia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This function is based on this description: | |
-- https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html | |
CREATE OR REPLACE FUNCTION | |
sign_s3_url( | |
m_host text, | |
m_verb text, | |
m_resource text, | |
m_region text, | |
m_key text, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getHost = (context: NextPageContext): { host: string; proto: string } => { | |
const { req } = context; | |
if (req !== undefined) { | |
const { | |
"x-forwarded-host": host, | |
"x-forwarded-proto": proto | |
} = req.headers; | |
if ( | |
typeof host === "string" && | |
typeof proto === "string" && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"build": { | |
"env": { | |
"MY_GH_TOKEN": "@my_gh_packages_access_token", | |
"NPM_RC": "registry=https://npm.pkg.github.com/<USERNAME or ORG>\n//npm.pkg.github.com/:_authToken=${MY_GH_TOKEN}\n//npm.pkg.github.com/<USERNAME or ORG>/:_authToken=${MY_GH_TOKEN}\nalways-auth=true\n" | |
} | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"RECTANGLE": { | |
"type": "RECTANGLE", | |
"name": "Rectangle", | |
"visible": true, | |
"locked": false, | |
"opacity": 1, | |
"blendMode": "PASS_THROUGH", | |
"isMask": false, | |
"effects": [], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Block { | |
case h(title: String) | |
case p(body: String) | |
} | |
extension View { | |
func erased() -> AnyView { | |
return AnyView(self) | |
} | |
} |
NewerOlder