Skip to content

Instantly share code, notes, and snippets.

View eyaleizenberg's full-sized avatar

Eyal Eizenberg eyaleizenberg

View GitHub Profile
import { HelloPerson, Props } from './hello_person.component';
import { shallow } from 'enzyme';
export class HelloPersonDriver {
private wrapper;
private props: Props = {
name: 'some name'
}
given = {
import * as React from 'react';
export interface Props {
name: string;
}
export class HelloPerson extends React.PureComponent<Props> {
render() {
return (
<div>
<!DOCTYPE html>
<html>
<head>
<title>News & Resources</title>
</head>
<body>
<h1>Welcome to News & Resources!</h1>
<p>Have fun!</p>
interface IProps {
superhero: string;
}
interface IState {
health: number;
}
export class MyComponent extends React.PureComponent<IProps, IState> {
state: IState;
interface IProps {
superhero: string;
}
interface IState {
health: number;
}
const getInitialHealth = (props: IProps) => props.superhero === "Spiderman" ? 0 : 100;
interface IProps {
superhero: string;
}
interface IState {
health: number;
}
export class MyComponent extends React.PureComponent<IProps, IState> {
readonly state = { health: 100 };
interface IProps {
superhero: string;
}
interface IState {
health: number;
}
export class MyComponent extends React.PureComponent<IProps, IState> {
render() {
@eyaleizenberg
eyaleizenberg / state_in_constructor.tsx
Last active June 29, 2018 06:31
state in constructor
interface IProps {
superhero: string;
}
interface IState {
health: number;
}
export class MyComponent extends React.PureComponent<IProps, IState> {
constructor(props: IProps) {
is_hebrew="$(defaults read ~/Library/Preferences/com.apple.HIToolbox.plist AppleSelectedInputSources)"
lang="EN"
if [[ $is_hebrew = *"Hebrew"* ]]; then
lang="HE"
fi
tm_segment "" "colour243" "$lang"
tm_divider

The Doom (stylized as DOOM) franchise is a series of first-person shooter video games developed by id Software. The series focuses on the exploits of an unnamed space marine operating under the auspices of Union Aerospace Corporation (UAC), who fights hordes of demons and the undead in order to survive.

The objective of the game is to clear a rectangular board containing hidden "mines" or bombs without detonating any of them, with help from clues about the number of neighboring mines in each field.

This game is a hybrid of both of these games. The gameplay of Minesweeper and the theme of DOOM.

The game is built using React, Redux and Typescript.

Here is the code which 'conjures' the 'demons' (mines) on the game matrix. It will loop until all demons have been set in the game: