[ => { | |
let getFunc; | |
let setFunc; | |
// Clone the original "localStorage" | |
const originalLocalStorage = window.localStorage; | |
beforeEach(() => { |
This file contains 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
class HashNode<T> { | |
key: string; | |
value: T; | |
next: HashNode<T> | null; | |
constructor(key: string, value: T) { | |
this.key = key; | |
this.value = value; | |
this.next = null; | |
} |
This file contains 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
"use strict"; | |
/** | |
* Hypertext Transfer Protocol (HTTP) response status codes. | |
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes} | |
*/ | |
enum HttpStatusCode { | |
/** | |
* The server has received the request headers and the client should proceed to send the request body |
vim ~/.gitconfig
[alias]
aa = add --all
br = branch
bv = branch -vv
This file contains 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
#!/usr/bin/env bash | |
# Assuming you have a master and dev branch, and that you make new | |
# release branches named as the version they correspond to, e.g. 1.0.3 | |
# Usage: ./release.sh 1.0.3 | |
# Get version argument and verify | |
version=$1 | |
if [ -z "$version" ]; then | |
echo "Please specify a version" |
This file contains 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
#!/usr/bin/env bash | |
# Assuming you have a master and dev branch, and that you make new | |
# release branches named as the version they correspond to, e.g. 1.0.3 | |
# Usage: ./release.sh 1.0.3 | |
# Get version argument and verify | |
version=$1 | |
if [ -z "$version" ]; then | |
echo "Please specify a version" |
This file contains 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 chalk = require('chalk'); | |
const log = console.log; | |
function runBenchmark(description, operations, callback) { | |
const start = process.hrtime.bigint(); | |
for (let i = 0; i < operations; i++) { | |
callback(); | |
} | |
const end = process.hrtime.bigint(); |
This file contains 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(str) { | |
var newStr = str; | |
if (newStr) { | |
newStr = newStr.toLowerCase(); | |
newStr = newStr.replace(/̀|̣.|΄|̃|̉/g, ''); | |
newStr = newStr.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, 'a'); | |
newStr = newStr.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, 'e'); | |
newStr = newStr.replace(/ì|í|ị|ỉ|ĩ/g, 'i'); | |
newStr = newStr.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, 'o'); | |
newStr = newStr.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g, 'u'); |
NewerOlder