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
# Add this to ~/.config/ after installing starship via homebrew and initialising it in zsh | |
command_timeout = 1000 | |
# --- | |
[battery] | |
full_symbol = "🔋" | |
charging_symbol = "🔌" | |
discharging_symbol = "⚡" |
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
// Binary Search Easy 1 | |
// Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1. | |
// You must write an algorithm with O(log n) runtime complexity. | |
// Example 1: | |
// Input: nums = [-1,0,3,5,9,12], target = 9 | |
// Output: 4 |
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 storage = () => { | |
const hasStorage = () => { | |
try { | |
const test = 'test' | |
localStorage.setItem(test, test) | |
localStorage.removeItem(test) | |
return true | |
} catch (e) { | |
return false | |
} |
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
export enum FormFields { | |
USERNAME = 'username', | |
GENDER = 'gender', | |
HEIGHT = 'height', | |
SKILLS = 'skills', | |
DATE_OF_BIRTH = 'dob', | |
LANGUAGES = 'languages', | |
COMPLEXION = 'complexion', | |
BUILD = 'build', | |
COUNTRY = 'country', |
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
// Your field can only contain | |
// alphabets and numbers separated by period (.), hyphen (-), and underscore (_) and should begin with an alphabet | |
const usernameRegex = /^[a-z](?:[_.-]?[a-z0-9])*$/; |
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
import { useCallback } from 'react'; | |
import useLocalStorage from 'use-local-storage'; | |
enum ColorScheme { | |
Dark = 'dark', | |
Light = 'light', | |
} | |
const useTheme = (): [`${ColorScheme}`, () => void] => { | |
const isUserDefaultThemeDark = window.matchMedia( |
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
# Load oh-my-zsh library | |
antigen use oh-my-zsh | |
# Select theme | |
antigen theme spaceship-prompt/spaceship-prompt | |
# Load bundles from the default repo (oh-my-zsh) | |
antigen bundle git | |
antigen bundle command-not-found | |
antigen bundle yarn |
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
# NVM Config | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm | |
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion | |
# NVM bundle | |
export NVM_LAZY_LOAD=true | |
# Load Antigen | |
source /usr/local/share/antigen/antigen.zsh |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
NewerOlder