Skip to content

Instantly share code, notes, and snippets.

Stoutie jehoshua02

Block or report user

Report or block jehoshua02

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ascii chess board.txt
♜♞♝♛♚♝♞♜
♟♟♟♟♟♟♟♟
□■□■□■□■
■□■□■□■□
□■□■□■□■
■□■□■□■□
♙♙♙♙♙♙♙♙
♖♘♗♕♔♗♘♖
@jehoshua02
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
[] ->
Nothing
_ ->
let
randomInt =
Random.int 0 ((List.length xs) - 1)
@jehoshua02
jehoshua02 / react_pros_cons.md
Created Jan 29, 2016
I spent 30 minutes putting together pros and cons for React
View react_pros_cons.md

Pros

Simple

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
<?php
class Counts
{
protected $counts = [];
public function inc($key)
{
if (!array_key_exists($key, $this->counts)) {
$this->counts[$key] = 0;
@jehoshua02
jehoshua02 / index.md
Created Oct 7, 2015
Zendo Rules, Plain Markdown Version, adapted from http://www.koryheath.com/zendo/
View index.md

Zendo

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

View prototypal_inheritance_the_right_way.md

Prototypal Inheritance The Right Way

According to the defacto ES6 Compiler, Babel:

class Monkey extends Mammal {
  
}
View PR_Template_Bookmark.md

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
jehoshua02 / JsonFileDataProviderIterator.php
Last active Jun 15, 2018
JsonFileDataProviderIterator class for use with PHPUnit @dataProvider annotation.
View JsonFileDataProviderIterator.php
<?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>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
console.log('hello');
You can’t perform that action at this time.