This file contains 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 React from 'react' | |
const ImageContent = ({ data: { src } }) => { | |
return ( | |
<div> | |
<img src={src} /> | |
</div> | |
) | |
} |
This file contains 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
// 21:13 | |
// Given urls ['url1', 'url2', 'url2', 'url3'...], limit | |
// Function `process` should `get` all urls, respecting limit and return when finished. | |
// Limit means that at the same time there should be N (limit) requests in progress, at least and at most | |
// Duplicate urls shouldn't be processed again, but the final order should be the same | |
// Get is used to mock requests | |
function get(url) { | |
return Promise.resolve("result" + url); | |
} |
This file contains 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
type themes = 'light' | 'dark' | |
export const themeProps = { | |
light: { | |
color1: 'black', | |
color2: 'white', | |
dark: 'black', | |
}, | |
dark: { | |
color1: 'yellow', |
This file contains 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
// What promise resolves faster (what will be printed as value)? | |
A = new Promise((resolve) => resolve("A")) | |
.then((a) => a) | |
.then((a) => { | |
console.log(a); | |
return a; | |
}); | |
B = new Promise((resolve) => resolve("B")) |
This file contains 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
@drums (drums) + (gain 10) | |
play @drums | |
(rhythm [2n]) | |
(notes [3 1 5 4 6 7 8 2 4 5]) | |
@melody (adsr (osc [sine])) + (gain 0.2) + (filter hp 1) + (delay 1n 0.4 1 7) + (pan (lerp -1 1 16)) | |
@melody2 (adsr (osc [square])) + (gain 0.1) | |
play @melody |
This file contains 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 React, { Component } from "react"; | |
import "./GameResults.css"; | |
class GameResults extends Component { | |
constructor(props) { | |
super(props); | |
this.state = {}; | |
} |
This file contains 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
REACT NATIVE IOS vs ANDROID FONT USE | |
Tested for React Native 0.41+ | |
IOS: | |
- Place the fonts in the assets and make sure they are bundled along | |
- On iOS, fontFamily in Text match the Font Family name as described in Font Book (macOS). Font weights can be specified exactly. | |
ANDROID: | |
On Android, there are two ways of using fonts: |
This file contains 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
/* @flow */ | |
import _ from 'lodash'; | |
import u from 'updeep'; | |
import { handleActions } from 'redux-actions'; | |
import { typicalMetaState, typicalMetaUnknownError, typicalSimpleMetaState } from '../utils/index'; | |
import * as AT from '../constants/ActionTypes'; | |
import type { IResponseHandler, TypicalAction, TypedAction } from '../typings'; | |
import type { | |
IQuestionQueueState, | |
IQuestionQueueItem, |
This file contains 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
$ npm set init.author.name "Your Name" | |
$ npm set init.author.email "[email protected]" | |
$ npm set init.author.url "http://yourblog.com" | |
$ npm adduser |
This file contains 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
# git config branch.master.rebase true | |
git config --global branch.autosetuprebase always |
NewerOlder