This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const vcf = require('vcf'); | |
const vcardParser = require('vcard-parser'); | |
// Utils | |
const writeToFile = (fileName, content) => { | |
fs.writeFileSync(fileName, content); | |
}; | |
const cleanPhoneNumber = (num) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
========================================= | |
Step 1 — Installing Certbot | |
sudo snap install core; sudo snap refresh core | |
Remove if ready installed | |
sudo apt remove certbot | |
sudo snap install --classic certbot | |
sudo ln -s /snap/bin/certbot /usr/bin/certbot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Debug - App", | |
"runtimeArgs": ["-r", "ts-node/register"], | |
"args": ["${workspaceFolder}/src/index.ts"] | |
} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const deasync = require('deasync') | |
const axios = require('axios') | |
const cp = require('child_process'); | |
function promiseToSync(func) { | |
let isDone = false; | |
let resp | |
func().then(data => { | |
isDone = true; | |
resp = data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/gitSambhal | |
// Author: Suhail Akhtar | |
const regex = /^[\p{L}\p{M}\p{N}\p{P}\p{S}\s]+$/u; | |
const names = [ | |
// English | |
[ | |
'John', | |
'Mary', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo PROGRAM_NAME:%~nx0 Start | |
echo. | |
================================ | |
SET debugMode=%1 | |
call :myFunc1 %debugMode% | |
call :myFunc2 para1 "para2 hello" | |
================================ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* | |
* @param {Array} arr Array of object to convert to HTML table | |
* @param {Array} takeOnly Array of keys to keep in the resulting HTML table | |
* @param {Array} blacklist Array of keys to skip in the resulting HTML table | |
* @return {String} HTML Table | |
*/ | |
export const ArrayOfObjectsToTable = function ({ arr = [], takeOnly = [], blacklist = [] }) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When Invalid Host Header when ngrok tries to connect to Angular or React dev server use this form for run ngrok. | |
ngrok http 8080 -host-header="localhost:8080" | |
ngrok http --host-header=rewrite 8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function saveSelection() { | |
if (window.getSelection) { | |
var sel = window.getSelection(); | |
if (sel.getRangeAt && sel.rangeCount) { | |
return sel.getRangeAt(0); | |
} | |
} else if (document.selection && document.selection.createRange) { | |
return document.selection.createRange(); | |
} | |
return null; |
NewerOlder