Skip to content

Instantly share code, notes, and snippets.

@ansiz
ansiz / gencert.sh
Created August 3, 2018 14:23
generate self-signed ssl certs
#!/bin/sh
# create self-signed server certificate:
read -p "Enter your domain [www.example.com]: " DOMAIN
echo "Create server key..."
openssl genrsa -des3 -out $DOMAIN.key 1024
@ansiz
ansiz / URIParser.js
Last active April 17, 2018 01:11
JavaScript URI parser in regular expressions
function parseURI(url) {
var m = String(url).replace(/^\s+|\s+$/g, '').match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
// authority = '//' + user + ':' + pass '@' + hostname + ':' port
return (m ? {
href: m[0] || '',
protocol: m[1] || '',
authority: m[2] || '',
host: m[3] || '',
hostname: m[4] || '',
port: m[5] || '',
@mkjiau
mkjiau / axios-interceptors-refresh-token.js
Last active March 13, 2024 10:59
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
@iamskok
iamskok / git-message-prefixes.md
Last active March 17, 2024 18:12
List of git commit message prefixes

Git commit message prefixes

  • [RFR] - Code refectoring
  • [WIP] - Work in progress
  • [FIX] - Bug fix
  • [FTR] - New feature
  • [SCR] - Security issue fix
  • [CLP] - Changes that do not alter functionality, but improve code style and readability.
  • [CRO] - Content Rate Optimization
  • [TST] - Add test suite for slider component