Skip to content

Instantly share code, notes, and snippets.

View patrickhpan's full-sized avatar

Patrick Pan patrickhpan

View GitHub Profile
yabai -m query --spaces | jq 'reverse | .[] | select(.windows | length == 0).index' | while read id; do yabai -m space $id --destroy; done
@patrickhpan
patrickhpan / one-per-page.js
Created April 27, 2017 22:10
react-sketchapp: one per page
import React from 'react';
import { Artboard, View, Text, render } from 'react-sketchapp';
let content = [
<Artboard>Hello World</Artboard>,
<Artboard>Foo Bar</Artboard>
]
export default context => {
let document = context.document;
@patrickhpan
patrickhpan / multiple-artboards.js
Last active May 5, 2019 20:30
Multiple artboards in react-sketchapp
import React from 'react';
import { render, Artboard, Text, View, StyleSheet } from 'react-sketchapp';
const layout = {
width: 375,
height: 667,
cols: 3,
margin: 100
}