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

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.

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.

@mehrdad-shokri
mehrdad-shokri / SSL-certs-OSX.md
Created February 17, 2018 22:25 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

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.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@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
@mehrdad-shokri
mehrdad-shokri / nginxproxy.md
Created January 16, 2018 12:43 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@mehrdad-shokri
mehrdad-shokri / SagaManager.js
Created January 6, 2018 19:58 — forked from hoschi/SagaManager.js
Hot reloadable redux-saga ... sagas
import mySaga from 'mySaga';
import { take, fork, cancel } from 'redux-saga/effects';
const sagas = [mySaga];
export const CANCEL_SAGAS_HMR = 'CANCEL_SAGAS_HMR';
function createAbortableSaga (saga) {
if (process.env.NODE_ENV === 'development') {
return function* main () {
@mehrdad-shokri
mehrdad-shokri / AppServiceProvider.php
Last active January 3, 2018 13:02
Laravel default string length limit
use Illuminate\Support\Facades\Schema;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
@mehrdad-shokri
mehrdad-shokri / distance.sql
Created December 1, 2017 11:17 — forked from aramonc/distance.sql
MySQL function to calculate the distance between two coordinates using the Haversine formula. Leaving it here for future reference.
DELIMITER $$
CREATE FUNCTION `haversine` (lat1 DECIMAL(8,6), lng1 DECIMAL(8,6), lat2 DECIMAL(8,6), lng2 DECIMAL(8,6)) RETURNS DECIMAL(8,6)
BEGIN
DECLARE R INT;
DECLARE dLat DECIMAL(30,15);
DECLARE dLng DECIMAL(30,15);
DECLARE a1 DECIMAL(30,15);
DECLARE a2 DECIMAL(30,15);
DECLARE a DECIMAL(30,15);
DECLARE c DECIMAL(30,15);
@mehrdad-shokri
mehrdad-shokri / Configure Keycloak Laravel
Created October 24, 2017 13:01 — forked from Bouhnosaure/Configure Keycloak Laravel
A way to use Keycloak as provider for login into laravel
This gist is created because the library i use eloquent-oauth-l5 has a pull-request (custom providers feature ) awaiting a merge
So here my way to use this feature and use keycloak as custom provider.
Inside composer.json
"repositories": [
{
"type": "vcs",
"url": "https://github.com/tysonlt/eloquent-oauth-l5"
}