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
export const containsHTML = (str) => /<[a-z][\s\S]*>/i.test(str); |
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'; | |
import { Route } from 'react-router-native'; | |
const renderMergedProps = (component, ...rest) => { | |
const finalProps = Object.assign({}, ...rest); | |
return React.createElement(component, finalProps); | |
}; | |
const PropsRoute = ({ component, ...props }) => ( | |
<Route |
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 { Buffer } from 'buffer'; | |
const generateBasicToken = (user, pass) => | |
new Buffer([user, pass].join(':')).toString('base64'); |
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
const asyncCompose = (…functions) => input => functions.reduceRight((chain, func) => chain.then(func), Promise.resolve(input)); | |
const asyncPipe = (…functions) => input => functions.reduce((chain, func) => chain.then(func), Promise.resolve(input)); |
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 { View, TextInput, Animated } from 'react-native'; | |
import Icon from '../Icon'; | |
export default class FloatingLabelInput extends Component { | |
state = { | |
isFocused: false | |
}; | |
componentWillMount() { |
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
const parseHex = (hex) => (startChar, endChar) => | |
parseInt(hex.slice(startChar, endChar), 16); | |
function hexToRGBA(hex, a = 1) { | |
const r = parseHex(hex)(1, 3); | |
const g = parseHex(hex)(3, 5); | |
const b = parseHex(hex)(5, 7); | |
return `rgba(${r},${g},${b},${a})`; | |
} |
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
const pipe = (...ops) => ops.reduce( | |
(a, b) => (...arg) => b(a(...arg)) | |
) |
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
const bytes = (s) => ~-encodeURI(s).split(/%..|./).length; | |
const jsonSize = (s) => bytes(JSON.stringify(s)); |
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
function walk(dirPath) { | |
const stats = fs.lstatSync(dirPath) | |
let type = mime.lookup(dirPath) | |
var data = [] | |
if(stats.isFile()) { | |
data.push({ | |
path: dirPath.replace(/\\/gi, '/'), | |
name: path.basename(dirPath), | |
type |
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
@mixin scanlines($color, $height: 1px, $angle: 0, $opacity: 0.2) { | |
position: relative; | |
&:after { | |
background-image: repeating-linear-gradient(to bottom, transparent 0 ,transparent $height, $color $height, $color $height * 2); | |
background-size: 100% $height * 2, cover; | |
transform-origin: 50% 50%; | |
transform: rotate($angle); | |
content: ''; | |
opacity: $opacity; | |
position: absolute; |