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
dokku apps:create minio | |
dokku config:set minio MINIO_ACCESS_KEY=$(echo `openssl rand -base64 45` | tr -d \=+ | cut -c 1-20) | |
dokku config:set minio MINIO_SECRET_KEY=$(echo `openssl rand -base64 45` | tr -d \=+ | cut -c 1-32) | |
sudo mkdir -p /var/lib/dokku/data/storage/minio | |
sudo chown 32769:32769 /var/lib/dokku/data/storage/minio | |
dokku storage:mount minio /var/lib/dokku/data/storage/minio:/home/dokku/data | |
dokku domains:set minio minio.MY_DOMAIN.com |
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
cat ~/.ssh/id_rsa.pub | ssh root@MY_DOKKU_SERVER dokku ssh-keys:add MY_KEY_NAME |
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
wget https://raw.githubusercontent.com/dokku/dokku/v0.12.10/bootstrap.sh | |
sudo DOKKU_TAG=v0.12.10 bash bootstrap.sh |
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
// You can test it in the browser here: https://codepen.io/svschannak/pen/KoLZvm?editors=0011 | |
// try to avoid using const and arrow functions to declare an function, it will help you while debugging | |
function flatten_array(originList){ | |
/** | |
* Flattens an input list with multi levels. | |
* WORKS only with ES6 | |
* Description. (use period) | |
* @param {Array[List]} originList Array List to be flattened. | |
* | |
* @return {Array[List]} New flattened array list. |
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'; | |
import MyGreatComponent from './my-component'; | |
class ErrorBoundary extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { hasError: false }; | |
} | |
componentDidCatch(error, info) { |
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
/*================================================================================================== | |
Application: Utility Function | |
Author: John Gardner | |
Website: http://www.braemoor.co.uk/software/vat.shtml | |
Version: V1.0 | |
Date: 30th July 2005 | |
Description: Used to check the validity of an EU country VAT number |
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
version: '3' | |
services: | |
mongo-parse-server: | |
image: mongo | |
ports: | |
- 27017:27017 | |
parse-server: | |
image: parseplatform/parse-server | |
links: | |
- mongo-parse-server |
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
nativefier --name "Google Drive" "https://drive.google.com/drive/recent" |
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
npm install nativefier -g |
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
#!/bin/sh | |
# Redirect output to stderr. | |
exec 1>&2 | |
# enable user input | |
exec < /dev/tty | |
consoleregexp='^\+.*console\.log(' | |
# CHECK | |
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0 | |
then |