Skip to content

Instantly share code, notes, and snippets.

View rabat's full-sized avatar

Rabat Chowdhury rabat

View GitHub Profile
@rabat
rabat / SSL-certs-OSX.md
Created April 7, 2021 15:16 — 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:

@rabat
rabat / 2019-https-localhost.md
Created April 7, 2021 14:56 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@rabat
rabat / README.md
Created February 6, 2019 08:48 — forked from kevinbull/README.md
Using JavaScript generate a 32 character hexadecimal universal id string.

generateUnid

Each call returns a random 32 character hexidecimal string. Based on the work done https://gist.github.com/jed/982883

Usage:

<script src="https://gist.github.com/kevinbull/f1cbc5440aa713bd5c9e.js"></script>

var unid = generateUnid();
@rabat
rabat / responsive-image.html
Created February 6, 2019 04:48 — forked from waliurjs/responsive-image.html
Responsive image example
<picture>
<source media="(min-width: [browser_width]px)" srcset="/home/google-play-badge-lg.png">
<source media="(min-width: [browser_width]px)" srcset="/home/google-play-badge-md.png">
<img class="playstore-link" src="/home/google-play-badge-xs.png">
</picture>
@rabat
rabat / elasticsearch
Created January 3, 2017 06:32 — forked from philwinder/elasticsearch
A simple elasticsearch init.d script that works with the tar'ed version of elasticsearch on SuSe Enterprise 11 SP3. Move the extracted elasticsearch directory to /usr/share/elasticsearch. Copy this into /etc/init.d. Run with service elasticsearch start. Install service with chkconfig --add elasticsearch
#!/bin/sh
### BEGIN INIT INFO
# Provides: elasticsearch
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
@rabat
rabat / hashid.js
Created September 5, 2016 09:19 — forked from fiznool/hashid.js
Short 'hash' ID generator.
'use strict';
/**
* The default alphabet is 25 numbers and lowercase letters.
* Any numbers that look like letters and vice versa are removed:
* 1 l, 0 o.
* Also the following letters are not present, to prevent any
* expletives: cfhistu
*/
var ALPHABET =
@rabat
rabat / Liberal Regex Pattern for All URLs
Created May 2, 2016 09:01 — forked from gruber/Liberal Regex Pattern for All URLs
Liberal, Accurate Regex Pattern for Matching All URLs
The regex patterns in this gist are intended to match any URLs,
including "mailto:foo@example.com", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
# Single-line version of pattern:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))