This file contains 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 strict'; | |
// Space Creatures | |
// =============== | |
// | |
// Involves: | |
// | |
// * Needs a game screen | |
// * alien creatures (3 different types) | |
// * a defender |
This file contains 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
#!/usr/bin/env bash | |
# derived from https://github.com/fastai/courses/blob/master/setup/install-gpu.sh | |
# exit on failed commands also print all commands | |
set -ex | |
cd $HOME |
This file contains 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
#!/usr/bin/env python3 | |
import csv | |
import os | |
import pathlib | |
import imageio | |
import numpy as np | |
This file contains 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
/** .pause-gif */ | |
.wrap-pause-gif { | |
position: relative; | |
text-align: center; | |
} | |
.pause-gif { | |
visibility: hidden; | |
} |
This file contains 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
export const computeOffset = elt => { | |
let rect = elt.getBoundingClientRect(); | |
let width = rect.width; | |
let height = rect.height; | |
let left = 0; | |
let top = 0; | |
let offsetParent = elt; | |
while (offsetParent) { | |
left += offsetParent.offsetLeft; |
This file contains 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
// # HTML5 Canvas: Fill Mixed Text | |
// | |
// ctx: CanvasRenderingContext2D | |
// args: array of objects of form | |
// { text: string, fillStyle?: string, font?: string } | |
// x: number | |
// y: number | |
// | |
const fillMixedText = (ctx, args, x, y) => { | |
let defaultFillStyle = ctx.fillStyle; |
This file contains 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
export function groupCollapsedFn<F extends Function>( | |
msg: any, func: F, | |
): F; | |
export function groupFn<F extends Function>( | |
msg: any, func: F, isCollapsed?: boolean | |
): F; |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Redux Undo Filter Test</title> | |
</head> | |
<body> | |
<p>See info in JS console</p> | |
<script src="store.js"></script> | |
</body> |
This file contains 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 PropTypes from 'prop-types'; | |
import React, { Component } from 'react'; | |
import { StripeProvider } from 'react-stripe-elements'; | |
export default class AsyncStripeProvider extends Component { | |
static propTypes = { | |
apiKey: PropTypes.string.isRequired | |
}; | |
// constructor |
This file contains 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
#!/usr/bin/env bash | |
# inspired by: https://gist.github.com/Vestride/278e13915894821e1d6f | |
INPUT=$1 | |
OUTDIR="out/" | |
if [ -z "$INPUT" ]; then | |
echo "No file specified" | |
exit 1 |