Skip to content

Instantly share code, notes, and snippets.

@Darmikon
Darmikon / gist:d9d7b69b7980b16364a437d84925a71a
Created August 29, 2020 13:06
Facebook privacy policy URL
Facebook privacy policy URL
@Darmikon
Darmikon / async-queue.ts
Last active July 8, 2020 21:27
async-queue.ts demo
type TCallback = (arg0?: any) => Promise<any>;
class AsyncQueue {
private queue: (() => void)[] = [];
private inProgress: boolean = false;
private intervalId: Timeout;
private interval: number = 1000;
private start() {
this.intervalId = setInterval(() => this.next(), this.interval);
@Darmikon
Darmikon / NginxRedirect.md
Created March 5, 2018 18:55 — forked from EmranAhmed/NginxRedirect.md
NGINX Redirect, Rewrite

Redirect: Temporary and Permanent

Source

What is an HTTP Redirect?

HTTP redirection, or URL redirection, is a technique of pointing one domain or address to another. There are many uses for redirection, and a few different kinds of redirection to consider.

As you create content and administrate servers, you will often find the need to redirect traffic from one place to another. This guide will discuss the different use-cases for these techniques, and how to accomplish them in Apache and Nginx.

@Darmikon
Darmikon / gist:c128cc308b618f6e61f5e38bc67a607e
Created February 11, 2018 19:39 — forked from oslego/gist:f13e136ffeaa6174289a
create self-signed certificate for localhost
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@Darmikon
Darmikon / Immutability-helper.js
Last active January 29, 2017 15:08
How to update deep nested structures in redux without headache with https://github.com/kolodny/immutability-helper
var src = {
obj: {
nestedArr: [
{
string: 'str_before'
}
]
},
arr: [
{