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
| function Cell(i, j, w, rows, cols) { | |
| let x, y; | |
| this.i = i; | |
| this.j = j; | |
| this.w = w; | |
| this.x = x = i * w; | |
| this.y = y = j * w; | |
| this.walls = [ | |
| [x, y, x + w, y], // TOP | |
| [x + w, y, x + w, y + w], // RIGHT |
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
| function createCombinations(input, result = []) { | |
| return multiply(input) | |
| } | |
| function multiply(inputArrays, result = []) { | |
| const [input, ...rest] = inputArrays | |
| if (!input) return result |
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
| declare module 'expo' { | |
| import {EventSubscription} from 'fbemitter'; | |
| import {ViewProperties, ViewStyle} from 'react-native'; | |
| /** | |
| * Expo Accelerometer | |
| */ | |
| export namespace Accelerometer { | |
| // TODO: good export type of x, y and z | |
| export interface AccelerometerObject { |
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 a = Math.random() >= 0.5; | |
| const b = Math.random() >= 0.5; | |
| const c = Math.random() >= 0.5; | |
| if (a) { | |
| if (b) { | |
| if (c) { | |
| return '111'; | |
| } else { | |
| return '110'; |
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
| [ | |
| "Patent Trolls", | |
| "David Cameron", | |
| "Xenophobia", | |
| "Everything", | |
| "Irresponsible Drug Policy", | |
| "Money", | |
| "Jay Walking", | |
| "Spicy Food", | |
| "Caffeine", |
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
| ###################################################################### | |
| # Unit Tests: Run unit tests/specs before committing | |
| ###################################################################### | |
| ./node_modules/.bin/gulp | |
| EXIT_CODE=$? | |
| if [[ ${EXIT_CODE} -ne 0 ]]; then | |
| echo "[ERRROR] code = " ${EXIT_CODE} | |
| echo "Tests failed." | |
| echo "Commit aborted." | |
| exit 1 |
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
| 'use strict'; | |
| /** | |
| * @returns {Promise} that will be resolved | |
| */ | |
| function doSomething () { | |
| return new Promise(function( resolve, reject ){ | |
| setTimeout(function(){ | |
| resolve(); | |
| }, Math.random() * 1000 ); |
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
| function giveMe ( n, callable ) { | |
| return Array.apply( null, new Array( n ) ).map( callable ); | |
| } | |
| function Canvas ( id ) { | |
| this.canvas = document.getElementById( id ); | |
| // fullscreen | |
| this.canvas.width = window.innerWidth; | |
| this.canvas.height = window.innerHeight; | |
| // create a rendering context |
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
| function ScalarParallaxAnimation( selector, cssProp, scaleMin, scaleMax, valueMin, valueMax, isInteger ) { | |
| isInteger = isInteger || false; | |
| this.$target = $(selector); | |
| this.cssProp = cssProp; | |
| this.scaleMin = scaleMin; | |
| this.scaleMax = scaleMax; | |
| this.valueMin = valueMin; | |
| this.valueMax = valueMax; | |
| this.isInteger = isInteger; | |
| this.setCssValue( valueMin ); |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="uk.co.mattjewell.app" > | |
| <application | |
| android:allowBackup="true" | |
| android:icon="@drawable/ic_launcher" | |
| android:label="@string/app_name" | |
| android:theme="@style/AppTheme" > | |
| <activity |
NewerOlder