Skip to content

Instantly share code, notes, and snippets.

View ascii chess board.txt
jehoshua02 / randomItem.elm
Last active Sep 30, 2016
Here's how I would have liked to get a random number in elm
View randomItem.elm
randomItem : List a -> Maybe a
randomItem xs =
case xs of
[] ->
_ ->
randomInt = 0 ((List.length xs) - 1)
jehoshua02 /
Created Jan 29, 2016
I spent 30 minutes putting together pros and cons for React



React allows us to define UI Components. That's it.

it's easy to trace what came from outside the component (props), what is managed inside the component (state), how the component will render based on those things (render).

View Counts.php
class Counts
protected $counts = [];
public function inc($key)
if (!array_key_exists($key, $this->counts)) {
$this->counts[$key] = 0;
jehoshua02 /
Created Oct 7, 2015
Zendo Rules, Plain Markdown Version, adapted from


ZendoDoes a dog have Buddha-nature?
This is the most serious question of all.
If you answer yes or no
You lose your own Buddha-nature.

Zendo is a game of inductive logic in which the Master creates a rule and the Students attempt to discover it by building and studying arrangements of Looney Pyramids. The first student to state the rule correctly wins.

What You Need


Prototypal Inheritance The Right Way

According to the defacto ES6 Compiler, Babel:

class Monkey extends Mammal {

PR Template Bookmark

javascript:(function pullRequestTemplate() {
  var e = document.activeElement;
  if (e) {
    e.value += [
      '#### What does this PR do?',
      '#### Where should the reviewer start?',
      '#### How should this be manually tested?',
jehoshua02 / JsonFileDataProviderIterator.php
Last active Jun 15, 2018
JsonFileDataProviderIterator class for use with PHPUnit @dataProvider annotation.
View JsonFileDataProviderIterator.php
class JsonDataProviderIterator implements Iterator
protected $position = 0;
protected $array;
public function __construct($test, $namespace)
$path = preg_replace('/.php$/', '.data', $test) . '/' . $namespace;
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>JS Bin</title>
<script id="jsbin-javascript">
You can’t perform that action at this time.