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
#!/bin/bash | |
# Opens PR if PR is open and commit (sha) exists on remote, else opens repo | |
# | |
# Requires environment variable GITHUB_USER_KEY to be set e.g. github_username:github_token | |
# See https://github.com/settings/tokens | |
# | |
# Ensure open-github.sh has execute permissions | |
# Set alias github="~/open-github.sh" |
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
import PropTypes from 'prop-types'; | |
import React, { Component, Fragment } from 'react'; | |
class AsyncFragment extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
value: 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
const keyInputs = [ | |
['n', 1], | |
['e', 10], | |
['w', 100], | |
[' ', 1], | |
['y', 10], | |
['o', 100], | |
['r', 300], | |
['k', 200] | |
]; |
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 countdown: Rx.Observable = ( | |
inputStream: Rx.Observable<boolean>, | |
duration: number, | |
interval: number = 1000 | |
): Rx.Observable<number> => { | |
return inputStream | |
.switchMap((enabled) => { | |
return enabled ? Rx.Observable.timer(0, interval) | |
.takeUntil(Rx.Observable.timer(duration + interval)) : | |
Rx.Observable.never(); |
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
/* | |
* File : calc.js | |
* Description : A calculator node command line interface app. | |
* ------------------------------------------------------------------------------------------------ */ | |
var argv = require('minimist')(process.argv.slice(2)); | |
/** | |
* Sum two numbers together | |
* @param {number} num1 | |
* @param {number} num2 |