This file contains hidden or 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
const scribble = require('scribbletune') | |
const _ = require('lodash') | |
function randomInt (min, max) { | |
return Math.floor((Math.random() * max) + min) | |
} | |
function createPattern () { | |
let choices = ['x', '_'] | |
let pattern = '' |
This file contains hidden or 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
class Player { | |
constructor () { | |
// ctx, positions, dimensions, isJumping, jumpSpeed, fallSpeed etc... | |
} | |
jumpUp () { | |
this.isJumping = true | |
this.position.y -= this.jumpSpeed | |
this.jumpAnimationUp = requestAnimationFrame(this.jumpUp.bind(this)) // bind jumpUp to request animation frame |
This file contains hidden or 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
<?php | |
namespace my\name\space; | |
class Field { | |
private $table; // parent table is Table class | |
public $type; // field type, i.e. varchar, string etc.. | |
public $name; // field name | |
public $isNullable = false; |
This file contains hidden or 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
const observer = new Observer() | |
let u1 = new User({name: 'jan'}, observer) | |
let u2 = new User({name: 'piet'}, observer) | |
let u3 = new User({name: 'klaas'}, observer) | |
let u4 = new User({name: 'kees'}, observer) | |
u2.sendMessage('Hi everybody!') | |
// output: |
This file contains hidden or 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
<?php | |
namespace App\Utill; | |
class Pipe { | |
/** | |
* @var Any return value of last function | |
*/ | |
private $result = null; |
This file contains hidden or 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
<?php | |
namespace App\Utill; | |
class Request | |
{ | |
/** | |
* @var Object curl request | |
*/ |
This file contains hidden or 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
<?php | |
namespace App\Utill; | |
class Container { | |
/** | |
* @var Array container instances | |
*/ | |
public static $instances = []; |
This file contains hidden or 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
<?php | |
/** | |
* Example class | |
*/ | |
class Best | |
{ | |
use Manager; | |
public $name; |
This file contains hidden or 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
// compile with -std=c++1y | |
#include <algorithm> | |
#include <functional> | |
#include <iterator> | |
#include <vector> | |
namespace LoDash { | |
using std::begin; |
This file contains hidden or 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
<?php | |
class Mapper | |
{ | |
private $instance; | |
function __construct (string $type, string $method, array $data) | |
{ | |
if ($type == 'post') | |
{ |
OlderNewer