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
'use client'; | |
import React from 'react'; | |
import { useRef, useEffect } from 'react'; | |
// The dimensions of the tetris game. | |
const WIDTH = 300; | |
const HEIGHT = 500; | |
// The height of the topbar, in which the score and title of the |
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
import { useEffect, useRef } from 'react'; | |
// CONFIG | |
const WIDTH = 660; | |
const HEIGHT = 440; | |
const COLUMN_WIDTH = 20; | |
const COLUMNS = WIDTH / COLUMN_WIDTH; |
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
/* | |
Wanted a list to get all the names for each material design | |
icon. Could not find a list online, other than the page at: | |
https://material.io/icons/ | |
So I wrote a script to get all the icons from that page. Unfortunately | |
it is made in polymer which uses the shadowdom extensively. So | |
getting all the icons means digging through the entire dom and shadow | |
dom. |
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
// @flow | |
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import toJson from 'enzyme-to-json'; | |
import PersonDetail from './PersonDetail'; | |
describe('Component: PersonDetail', () => { | |
test('ui', () => { |
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
// @flow | |
import React, { Component } from 'react'; | |
import DeleteButton from './DeleteButton'; | |
type Person = { | |
id: number, | |
name: string, | |
age: number |
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
// @flow | |
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import toJson from 'enzyme-to-json'; | |
import PersonDetail from './PersonDetail'; | |
describe('Component: PersonDetail', () => { | |
test('ui', () => { |
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
<div class="panel"> | |
<h1>Maarten</h1> | |
<h2>28</h2> | |
<DeleteButton onClick={[Function]} /> | |
</div> |
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
// @flow | |
import React, { Component } from 'react'; | |
type Props = { | |
hasNext: bool, | |
hasPrevious: bool, | |
nextClicked: () => void, | |
previousClicked: () => void | |
}; |
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
(ns foo.bar | |
(:require [cheshire.core :refer :all] | |
[cheshire.generate :refer [add-encoder]])) | |
(add-encoder org.postgresql.jdbc4.Jdbc4Array | |
(fn [array jsonGenerator] | |
(let [sequence (seq (.getArray array))] | |
(.writeStartArray jsonGenerator) | |
(doseq [i sequence] | |
(.writeString jsonGenerator i)) |