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
// ACTIONCREATORS USAGE EXAMPLE 1 | |
// When the action needed are all in a single duck (in this case authReducer) | |
import React, { Component, PropTypes } from 'react' | |
import { connect } from 'react-redux' | |
import { bindActionCreators } from 'redux' | |
import { actionCreators } from '../reducers/authReducer' | |
const mapStateToProps = (state, ownProps) => ({ | |
// blablabla | |
}) |
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
// Just a Deno script that bumps an NPM dependency of the project | |
// in the current directory. | |
// Might be helpful if you need to automate the bumping of a | |
// dependency across multiple repos. | |
// It: | |
// - Makes sure you start from a clean state | |
// - Auto-detects if using yarn or npm | |
// - Creates, commits, and pushes the changes in a separate branch | |
import * as Colors from "https://deno.land/std/fmt/colors.ts"; | |
import yargs from "https://deno.land/x/yargs/deno.ts"; |
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 * as React from "react"; | |
import { StyleSheet, TextInput } from "react-native"; | |
const BLUE = "#428AF8"; | |
const LIGHT_GRAY = "#D3D3D3"; | |
class MyTextInput extends React.Component { | |
state = { | |
isFocused: false | |
}; |
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
#!/bin/bash | |
input="input.mp4" | |
output="output.mp4" | |
color="black" | |
while getopts ":i:o:w:h:c:" opt; do | |
case $opt in | |
i) input="$OPTARG" | |
;; |
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 mobx from 'mobx' | |
const DEFAULT_STYLE = 'color: #006d92; font-weight:bold;' | |
// Just call this function after MobX initialization | |
// As argument you can pass an object with: | |
// - collapsed: true -> shows the log collapsed | |
// - style -> the style applied to the action description | |
export const startLogging = ({ collapsed, style } = {}) => { | |
mobx.spy(event => { |
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 React, { Component } from 'react' | |
import { View } from 'react-native-animatable' | |
import metrics from 'src/config/metrics' | |
type Props = { | |
isVisible: boolean, | |
backgroundColor: string, | |
animationTiming?: boolean | |
} |
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
Show hidden characters
[ | |
{ "keys": ["f12"], "command": "reindent", "args": {"single_line": false} }, | |
{ "keys": ["ctrl+space"], "command": "auto_complete" }, | |
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context": | |
[ | |
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" }, | |
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }, | |
{ "key": "setting.tab_completion", "operator": "equal", "operand": true } | |
] | |
}, |
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 { PixelRatio, Dimensions } from "react-native"; | |
const isTabletLike = () => { | |
const pixelDensity = PixelRatio.get(); | |
const adjustedWidth = Dimensions.get("screen").width * pixelDensity; | |
const adjustedHeight = Dimensions.get("screen").height * pixelDensity; | |
return ( | |
(pixelDensity < 2 && (adjustedWidth >= 1000 || adjustedHeight >= 1000)) || | |
(pixelDensity === 2 && (adjustedWidth >= 1920 || adjustedHeight >= 1920)) | |
); |