Skip to content

Instantly share code, notes, and snippets.

View mehrdad-shokri's full-sized avatar
🎯
Focusing

Mehrdad Shokri mehrdad-shokri

🎯
Focusing
View GitHub Profile
@mehrdad-shokri
mehrdad-shokri / common.env
Created August 12, 2021 23:04 — forked from edvard-rgb/common.env
Saleor platform using docker-compose, Traefik, NginX
DATABASE_URL=postgres://saleor:password@db/saleor
DEFAULT_FROM_EMAIL=noreply@domain.com
CELERY_BROKER_URL=redis://redis:6379/1
JAEGER_AGENT_HOST=jaeger
SECRET_KEY=secret_key
API_URI=https://saleor-api.domain.com/graphql/
ALLOWED_HOSTS=saleor-api.domain.com,saleor-mail.domain.com,saleor-store.domain.com,saleor-admin.domain.com,saleor-jaeger.domain.com
ALLOWED_CLIENT_HOSTS=saleor-api.domain.com,saleor-mail.domain.com,saleor-store.domain.com,saleor-admin.domain.com,saleor-jaeger.domain.com
@mehrdad-shokri
mehrdad-shokri / Dockerfile
Created April 11, 2021 20:46 — forked from Mikulas/Dockerfile
Docker image PHP 7.1 alpine with extensions
FROM php:7.1-fpm-alpine
RUN apk add --update \
autoconf \
g++ \
libtool \
make \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install mysqli \
@mehrdad-shokri
mehrdad-shokri / php-docker-ext
Created April 6, 2021 13:38 — forked from hoandang/php-docker-ext
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@mehrdad-shokri
mehrdad-shokri / Dockerfile
Created February 7, 2021 22:32 — forked from tylerchr/Dockerfile
Compiling V8 for alpine (link against musl)
#
# Building V8 for alpine is a real pain. We have to compile from source, because it has to be
# linked against musl, and we also have to recompile some of the build tools as the official
# build workflow tends to assume glibc by including vendored tools that link against it.
#
# The general strategy is this:
#
# 1. Build GN for alpine (this is a build dependency)
# 2. Use depot_tools to fetch the V8 source and dependencies (needs glibc)
# 3. Build V8 for alpine

Generate ssl certificates with Subject Alt Names on OSX

We're going to generate a key per project which includes multiple fully qualified domains. This key can be checked into the project repo as it's intended for local development but never used on production servers.

Save ssl.conf to your my_project directory.

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

Transforming Elements in React

Introduction

Transforming elements can be interesting if you're a library author, but can also be very valuable when writing components to abstract behaviour in your existing code base.

To get a better understanding, we will walkthrough the most important React Top Level API transformation functionalities. React offers a couple of helper functions that we can leverage when for creating and adapting elements, further information is available via the official React documentation.

@mehrdad-shokri
mehrdad-shokri / install-nginx-latest.sh
Created April 4, 2018 09:22 — forked from craigvantonder/install-nginx-latest.sh
Install Nginx Mainline / Stable on Ubuntu 16.04
#!/bin/bash
# https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
# Switch to root
sudo su
# Add the mainline release
echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" > /etc/apt/sources.list.d/nginx.list
@mehrdad-shokri
mehrdad-shokri / 1.Generate RootCA
Last active April 8, 2018 02:45
Install self signed certificates in ubuntu
openssl genrsa -out key.pem 2048
#OR if you want encrypted ca
openssl genrsa -de3 -out key.pem 2048
@mehrdad-shokri
mehrdad-shokri / introrx.md
Created February 2, 2018 21:33 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing