This file contains hidden or 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
figma.showUI(`<script> | |
let imurl = 'https://66.media.tumblr.com/7af65560449c91e8cd82a4a3478f5e0b/tumblr_pb7bt5CTrS1qzdllao1_1280.jpg' | |
fetch(imurl).then(r => r.arrayBuffer()).then(a => | |
parent.postMessage({ pluginMessage: ["imdata", new Uint8Array(a)] }, '*')) | |
</script>`, { visible:false, width:200, height:200 }) | |
figma.ui.onmessage = msg => { | |
if (msg[0] == "imdata") { | |
let data = msg[1] as Uint8Array | |
let imageHash = figma.createImage(new Uint8Array(data)).hash | |
const rect = figma.createRectangle() |
This file contains hidden or 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
declare class ReactTrelloBoard<CardMetaData> extends React.Component<ReactTrello.BoardProps<CardMetaData>> { | |
} | |
declare module ReactTrello { | |
/** | |
* react-trello uses `React.cloneElement`, so these props | |
* will have to be added to `defaultProps`, otherwise | |
* TypeScript will (understandably) freak out. | |
*/ | |
interface NewCardTemplateProps<CardMetaData = object> { |
This file contains hidden or 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
<statechart> = (state / <whitespace> / <comments>)+ | |
state = comments? state-name <whitespace>? <newline> block? | |
transition = comments? event-name <whitespace>? <'->'> <whitespace>? state-name <newline> | |
<block> = indent (state / transition / <whitespace> / <comments>)+ dedent | |
comments = comment (<newline> comment)* <newline> | |
<comment> = <'#'> #".*" |
This file contains hidden or 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
- Open Automator | |
- File -> New -> Service | |
- Change "Service Receives" to "files or folders" in "Finder" | |
- Add a "Run Shell Script" action | |
- Change "Pass input" to "as arguments" | |
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*" | |
- Save it as something like "Open in Visual Studio Code" |
This file contains hidden or 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
function OnBlurComponent({ onBlur }) { | |
const handleBlur = (e) => { | |
const currentTarget = e.currentTarget; | |
// Check the newly focused element in the next tick of the event loop | |
setTimeout(() => { | |
// Check if the new activeElement is a child of the original container | |
if (!currentTarget.contains(document.activeElement)) { | |
// You can invoke a callback or add custom logic here | |
onBlur(); |