- Remove all local branches (except master)
git branch | grep -v "master" | xargs git branch -D
| #!/bin/sh | |
| # Install common and docker | |
| apt-get update | |
| apt-get install -y apt-transport-https ca-certificates curl software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
| add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable" | |
| apt-get update && apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 17.03 | head -1 | awk '{print $3}') | |
| # Install kubelet, kubeadm kubectl |
| /** | |
| * @description Returns current route name. | |
| * @param routes | |
| * @returns {string} | |
| */ | |
| getRouteNameFromNavigatorState ({ routes }) { | |
| let route = routes[routes.length - 1]; | |
| while (route.index !== undefined) route = route.routes[route.index]; | |
| return route.routeName; | |
| } |
| # Add PGP key to install mysql 5.7 from mysql repository | |
| - name: Add PGP key | |
| apt_key: | |
| keyserver: hkp://pgp.mit.edu:80 | |
| id: 5072E1F5 | |
| - name: Add official APT repository | |
| apt_repository: | |
| repo: "deb http://repo.mysql.com/apt/debian/ stretch mysql-5.7" |
| const Test = (ms) => { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| if(ms === 20) reject(new Error('Bad value')); | |
| resolve('ok'); | |
| }, ms); | |
| }); | |
| } | |
| async function testUnhandled() { |
| patch-package | |
| --- a/node_modules/react-native-maps/index.js | |
| +++ b/node_modules/react-native-maps/index.js | |
| @@ -1,4 +1,4 @@ | |
| -import MapView from './lib/components/MapView'; | |
| +import MapView from './lib/components/MapView'; | |
| export { default as Marker } from './lib/components/MapMarker.js'; | |
| export { default as Polyline } from './lib/components/MapPolyline.js'; | |
| @@ -9,7 +9,9 @@ export { default as LocalTile } from './lib/components/MapLocalTile.js'; |
git branch | grep -v "master" | xargs git branch -D
| FROM debian:stretch | |
| ENV DEBIAN_FRONTEND noninteractive | |
| # install NGINX | |
| RUN apt-get update && \ | |
| apt-get install -y nginx --no-install-recommends && \ | |
| rm -rf /var/lib/apt/lists/* | |
| [!] 34 vulnerabilities identified from the version number | |
| [!] Title: WordPress 4.2-4.5.1 - MediaElement.js Reflected Cross-Site Scripting (XSS) | |
| Reference: https://wpvulndb.com/vulnerabilities/8488 | |
| Reference: https://wordpress.org/news/2016/05/wordpress-4-5-2/ | |
| Reference: https://github.com/WordPress/WordPress/commit/a493dc0ab5819c8b831173185f1334b7c3e02e36 | |
| Reference: https://gist.github.com/cure53/df34ea68c26441f3ae98f821ba1feb9c | |
| Reference: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-4567 | |
| [i] Fixed in: 4.5.2 |
If you wants to add a delay between two promise:
/**
* @description Add delay (ms) between promises
* @param delay
* @return {Promise}
*/
wait(delay) {
wait(delay) {
| After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
| The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
| Database files have to be updated before starting the server, here are the steps that had to be followed: | |
| # need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
| brew unlink postgresql | |
| brew install [email protected] | |
| brew unlink [email protected] | |
| brew link postgresql |