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
myObjectOfItems = myArray.reduce((obj, item) => { | |
obj[item['propertyToIsolate']] = null | |
return obj | |
}, {}); |
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
return new Promise((resolve, reject) => { | |
fetch("/api/v1/principal", { | |
method: 'GET', | |
headers: { | |
'Content-Type': 'application/json', | |
'Authorization': 'Bearer ' + access_token, | |
} | |
}) | |
.then(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
import AsyncStorage from '@react-native-community/async-storage'; | |
export default class CompanyDal{ | |
constructor(){ | |
this.readCompany = this.readCompany.bind(this); | |
this.reset = this.reset.bind(this); | |
this.initialize = this.initialize.bind(this); |
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 filterThings = (filter_word, things) =>{ | |
//console.log('filtering on ', filter_word); | |
let filteredThings = things.filter(thing => { | |
return thing.startsWith(filter_word); | |
}); | |
return filteredThings.sort(); | |
} | |
export default filterThings; |
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
onAutocompleteFocus(){ | |
this.setState({defaultValue:'@'}); | |
this.setState({hideSuggestions:false}); | |
} | |
onAutocompleteTextChange(context_value){ | |
let suggestions = this.state.suggestions; | |
let newSuggestions = suggestions.filter(suggestion => { | |
return suggestion.startsWith(context_value); | |
}); | |
this.setState({context_value}); |
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
brightnessByColor(color) { | |
let luminance = 0; | |
const isHEX = color.indexOf("#") == 0; | |
const isRGB = color.indexOf("rgb") == 0 | |
let m, r, g, b; | |
if (isHEX) { | |
m = color.substr(1).match(color.length == 7 ? /(\S{2})/g : /(\S{1})/g); | |
if (m) { | |
r = parseInt(m[0], 16); |
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
/** | |
* Calculate brightness value by RGB or HEX color. | |
* @param color (String) The color value in RGB or HEX (for example: #000000 || #000 || rgb(0,0,0) || rgba(0,0,0,0)) | |
* @returns (Number) The brightness value (dark) 0 ... 255 (light) | |
*/ | |
function brightnessByColor (color) { | |
var color = "" + color, isHEX = color.indexOf("#") == 0, isRGB = color.indexOf("rgb") == 0; | |
if (isHEX) { | |
var m = color.substr(1).match(color.length == 7 ? /(\S{2})/g : /(\S{1})/g); | |
if (m) var r = parseInt(m[0], 16), g = parseInt(m[1], 16), b = parseInt(m[2], 16); |
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 React from 'react'; | |
export default class Home extends React.Component{ | |
render(){ | |
return() | |
} | |
} |
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 path = require('path'); | |
const ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
const extractSass = new ExtractTextPlugin({ | |
filename: "[name].[contenthash].css", | |
disable: process.env.NODE_ENV === "development" | |
}); | |
module.exports = { |
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
{ | |
"name": "packer", | |
"version": "0.0.1", | |
"private": true, | |
"description": "API packer", | |
"scripts": { | |
"dev": "webpack-dev-server", | |
"build": "webpack", | |
"watch": "webpack --watch" | |
}, |
NewerOlder