Skip to content

Instantly share code, notes, and snippets.

View davidmatas's full-sized avatar
🏠
Working from home

David Matas davidmatas

🏠
Working from home
View GitHub Profile
import { constructor } from "mocha";
export default class GameOfLive {
}
type Dead = 0
type Alive = 1
type CellStatus = Dead | Alive;
import should from 'should';
import GameOfLife, { Cell } from '../../src/GameOfLife';
// 1. Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.
// 2. Any live cell with more than three live neighbours dies, as if by overcrowding.
// 3. Any live cell with two or three live neighbours lives on to the next generation.
// 4. Any dead cell with exactly three live neighbours becomes a live cell.
describe('GameOfLife', () => {
@davidmatas
davidmatas / viewunits.scss
Created June 8, 2016 12:34 — forked from seavor/viewunits.scss
Sass Mixin for V-Units to PXs for unsupported devices (vw, vh, vmin, vmax)
@function vunit($input, $width, $height){
@if unit($width) != px or unit($height) != px {
@error "function vunit() dimensions should contain a px unit. +[" + $width + ", " + $height +"]";
}
// Store $input unit
$unit: unit($input);
// Remove unit from $input and convert to ratio
$ratio: $input / ($input * 0 + 1) / 100;
// Calc and store return values
@davidmatas
davidmatas / mou.html
Last active March 1, 2023 16:42
highlight syntax for Mou.app
<!-- Highlight syntax for Mou.app, insert at the bottom of the markdown document -->
<script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>
<link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/github.min.css">
<script>
hljs.initHighlightingOnLoad();
</script>