-
devDependencies are things like
babel-cli
andprettier
orava
that you need to develop your app. If it is a command line tool or something that makes development possible, it should be here. -
install using
npm install <package> --dev
ornpm install <package> --save-dev
to add to package.json in devDependencies -
dependencies are packages that you are going to ship with the final product, and are required for your user to run your app, service or product.
-
install using
npm install <package>
ornpm install <package> --save
to add to package.json in dependencies -
sometimes dependencies can also be devDependencies. Lodash is a common example of a package that is commonly used for development code (think unit tests, configuration scripts and similar) as well as front end.
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
rm -rf /Applications/zoom.us.app/ | |
lsof -i :19421 | awk 'NR!=1{print $2}' | xargs kill -9 | |
rm -rf ~/.zoomus | |
touch ~/.zoomus |
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
"since 2017, not Baidu > 0, not QQAndroid > 0, not iOS > 0, not Samsung > 0, not Android > 0, not FirefoxAndroid > 0, not ChromeAndroid > 0" | |
or | |
"['chrome > 55', 'edge > 15', 'firefox > 52', 'safari > 10.1', 'opera > 42']" as of Nov 2018 | |
Both queries amount to the same things at one point in time, but the top one updates |
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() { | |
if [[ "$1" = "status" ]]; then | |
command git status; | |
command git --no-pager diff --shortstat HEAD | |
else | |
command git "$@" | |
fi | |
} |
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 pProps = require('p-props'); | |
const sleep = (message) => new Promise(resolve => setTimeout(() => resolve(message), Math.floor(Math.random() * 2500))); | |
const get = message => sleep(message).then(res => res); | |
const data = { | |
Amit: get('Amit'), | |
vitae: get('vitae'), | |
Lorem: { | |
Tellus: get('Tellus'), |
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
sendPushNotification(token = this.state.token, title = this.state.title, body = this.state.body) { | |
return fetch('https://exp.host/--/api/v2/push/send', { | |
body: JSON.stringify({ | |
to: token, | |
title: title, | |
body: body, | |
data: { message: `${title} - ${body}` }, | |
}), | |
headers: { | |
'Content-Type': 'application/json', |
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
async registerForPushNotifications() { | |
const { status } = await Permissions.getAsync(Permissions.NOTIFICATIONS); | |
if (status !== 'granted') { | |
const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS); | |
if (status !== 'granted') { | |
return; | |
} | |
} |
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 { | |
StyleSheet, | |
TextInput, | |
TouchableOpacity, | |
Text, | |
KeyboardAvoidingView, | |
View, | |
} from 'react-native'; | |
import { Permissions, Notifications } from 'expo'; |
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
/** | |
* Copyright (c) 2015-present, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
*/ | |
'use strict'; |
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
- declaritive pipeline uses sh | |
- inject PATH overrides in jenkinsfile environment property | |
- can be per file, per stage | |
- useful for node version - nvm doesn't always work, pollutes log. | |
``` | |
stage('Build') { | |
environment { | |
PATH='/usr/opt/someshit:$PATH' | |
} |
NewerOlder