Skip to content

Instantly share code, notes, and snippets.

@good-idea
good-idea / removeSaneShopifyDocuments.js
Created February 9, 2020 17:21
Remove all shopifyProducts and shopifyCollections from sanity dataset
/**
WARNING: THIS DELETES DATA
Run this within your Sanity project directory with:
yarn sanity exec --with-user-token removeSaneShopifyDocuments.js
**/
@good-idea
good-idea / gameoflife.js
Last active January 7, 2020 22:19
Game of Life in javascript
const SIZE = 24;
const generateBoard = () => {
return Array.from({ length: SIZE }, () => {
// return a row
return Array.from({ length: SIZE }, () => Math.round(Math.random()));
});
};
const printBoard = board => {
@good-idea
good-idea / xstyled-styled-components.d.ts
Last active May 27, 2021 05:20
Type definitions for @xstyled/styled-components
declare module '@xstyled/styled-components' {
import _styled, {
StyledComponent,
ThemedStyledInterface,
ThemedStyledFunction,
DefaultTheme,
FlattenSimpleInterpolation,
} from 'styled-components'
export * from 'styled-components'
@good-idea
good-idea / sudoku-node.ts
Created October 7, 2019 23:31
Sudoku on the CLI
/**
* Playable at: https://repl.it/@good_idea/Sudoku-Node
* The repl has some issues with the input, but it still works.
* The repl is also limited to one board.
*/
import * as inquirer from 'inquirer'
import chalk from 'chalk'
/**
2019-09-18 16:26:02,572 INFO [88962] (deoplete.logging) --- Deoplete Log Start ---
2019-09-18 16:26:02,573 INFO [88962] (deoplete.logging) NVIM v0.5.0-dev, Python 3.7.4, pynvim 0.3.2
2019-09-18 16:26:07,970 DEBUG [88962] (deoplete.core) initialized context: {'changedtick': 4, 'event': 'Init', 'filetype': 'typescript', 'filetypes': ['typescript'], 'input': ' ...TextBlockFragment', 'max_abbr_width': 83.33333333333333, 'max_kind_width': 83.33333333333333, 'max_info_width': 83.33333333333333, 'max_menu_width': 83.33333333333333, 'next_input': '', 'position': [0, 30, 34, 0], 'same_filetypes': [], 'bufnr': 1, 'bufname': 'views/Homepage/homepageQuery.ts', 'bufpath': '/Users/joseph/Sites/jemmawynne/jemmawynne.com/app/src/views/Homepage/homepageQuery.ts', 'camelcase': False, 'complete_str': '', 'custom': {'filter': {}, 'source': {'_': {}}, 'option': {'check_stderr': True, 'camel_case': False, 'on_text_changed_i': True, 'max_list': 16, 'candidate_marks': [], 'skip_multibyte': False, 'auto_refres
@good-idea
good-idea / SketchSystems.spec
Created February 5, 2019 18:33
Simple Traffic Light
Simple Traffic Light
Green*
tick -> Yellow
Yellow
tick -> Red
Red
tick -> Green
@good-idea
good-idea / countries.html
Created January 15, 2019 02:11
Country Select options (with Emoji flags)
<select name="country">
<option value="AF">Afghanistan πŸ‡¦πŸ‡«</option>
<option value="AO">Angola πŸ‡¦πŸ‡΄</option>
<option value="AL">Albania πŸ‡¦πŸ‡±</option>
<option value="AD">Andorra πŸ‡¦πŸ‡©</option>
<option value="AE">United Arab Emirates πŸ‡¦πŸ‡ͺ</option>
<option value="AR">Argentina πŸ‡¦πŸ‡·</option>
<option value="AM">Armenia πŸ‡¦πŸ‡²</option>
<option value="AG">Antigua and Barbuda πŸ‡¦πŸ‡¬</option>
<option value="AU">Australia πŸ‡¦πŸ‡Ί</option>
@good-idea
good-idea / SketchSystems.spec
Last active February 5, 2019 17:51
Editable Text*
Editable Text*
Normal*
hover -> Hover
Normal-Initial*
Normal-Success
Hover
leaveHover -> Normal
click -> Active
@good-idea
good-idea / SketchSystems.spec
Last active February 5, 2019 18:04
Map Editor*
Map Editor*
Welcome*
Lesson
clickedDropPin -> DropPin
Browse*
clickedItem -> Inspect
DropPin
@good-idea
good-idea / SketchSystems.spec
Last active November 20, 2018 19:59
Map Editor*
Map Editor*
Welcome*
Lesson
clickedDropPin -> DropPin
Browse*
clickedItem -> InspectItem
DropPin