Skip to content

Instantly share code, notes, and snippets.

View svschannak's full-sized avatar

Sven Schannak svschannak

View GitHub Profile
@svschannak
svschannak / dokku_ssh_key.sh
Created June 28, 2018 09:56
Add your SSH Key to your dokku server
cat ~/.ssh/id_rsa.pub | ssh root@MY_DOKKU_SERVER dokku ssh-keys:add MY_KEY_NAME
@svschannak
svschannak / dokku_minio_setup.sh
Last active June 28, 2018 10:02
Setup minio dokku
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
@svschannak
svschannak / dokku_ssl.sh
Created June 28, 2018 10:04
Dokku Minio SSL
dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
dokku config:set --no-restart minio [email protected]
dokku letsencrypt minio
@svschannak
svschannak / minio_client_max_body_size.sh
Created June 28, 2018 10:07
Minio client_max_body_size
mkdir /home/dokku/minio/nginx.conf.d/
echo 'client_max_body_size 50m;' > /home/dokku/minio/nginx.conf.d/upload.conf
chown dokku:dokku /home/dokku/minio/nginx.conf.d/upload.conf
service nginx reload
@svschannak
svschannak / react-router-typescript.js
Created September 5, 2018 17:40
React Router Match and Typescript
interface NewsletterDetailProps extends RouteComponentProps<any>, React.Props<any> {
}
const NewsletterDetail: React.StatelessComponent<NewsletterDetailProps> = props => {
const match = props.match;
return (
...
);
};
@svschannak
svschannak / docker-compose.yml
Created October 15, 2018 12:03
Zalenium on Mac OS
# Usage:
# docker-compose up --force-recreate
version: "2.1"
services:
#--------------#
zalenium:
image: "dosel/zalenium"
container_name: zalenium
hostname: zalenium
@svschannak
svschannak / selenium_remote_chrome_driver.py
Last active October 15, 2018 12:11
Selenium Remote chrome Driver in python
chrome_settings = webdriver.DesiredCapabilities.CHROME.copy()
remote_chrome_driver = webdriver.Remote(desired_capabilities=chrome_settings)
@svschannak
svschannak / xd_text_randomizer.js
Created October 25, 2018 15:47
XD text randomizer
function randomizeText(selection, documentRoot) {
documentRoot.children.forEach(node => {
// [1]
if (node instanceof Artboard) {
// [2]
let artboard = node;
let rectangles = artboard.children.filter(artboardChild => {
// [3]
return artboardChild instanceof Text;
@svschannak
svschannak / dokku-subtree.sh
Created January 16, 2019 09:06
Dokku & netlify subdirectory deployment
git subtree push --prefix backend subdomain master
(cd frontend && exec yarn run build)
(cd frontend && exec netlify deploy --dir=./build --prod)
@svschannak
svschannak / _redirects
Created January 22, 2019 12:24
Redirects for netlify and react router
/* /index.html 200