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
module.exports = { | |
env: { | |
browser: true, | |
es6: true, | |
node: true, | |
}, | |
extends: ['eslint:recommended', 'plugin:react/recommended'], | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, |
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
{ | |
"extends": [ | |
"eslint:recommended", | |
"plugin:@typescript-eslint/recommended", | |
"plugin:@typescript-eslint/recommended-requiring-type-checking" | |
], | |
"env": { | |
"node": true, | |
"es6": true |
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
var csv = require('csv-parser') | |
var fs = require('fs') | |
var countries = [] | |
fs.createReadStream('./data.csv') | |
.pipe(csv(['label', 'value'])) | |
.on('data', function (data) { | |
if (data.label === 'label' && data.value === 'value') return | |
countries.push({ value: data.value, label: data.label }) |
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
import Router from 'next/router'; | |
import NProgress from 'nprogress'; | |
import { useEffect } from 'react'; | |
export const LoadingBar = () => { | |
useEffect(() => { | |
let timer = 0; | |
NProgress.configure({ showSpinner: false }); | |
NProgress.done(); |
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
import { useState, useEffect } from "react"; | |
const useMediaQuery = (query) => { | |
const [matches, setMatches] = useState(false); | |
useEffect(() => { | |
const media = window.matchMedia(query); | |
if (media.matches !== matches) { | |
setMatches(media.matches); | |
} |
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
// Override key bindings by placing them into your key bindings file. | |
[ | |
{ "key": "escape escape", "command": "workbench.action.exitZenMode", | |
"when": "inZenMode" }, | |
{ "key": "shift+escape", "command": "closeReferenceSearch", | |
"when": "inReferenceSearchEditor && !config.editor.stablePeek" }, | |
{ "key": "escape", "command": "closeReferenceSearch", | |
"when": "inReferenceSearchEditor && !config.editor.stablePeek" }, | |
{ "key": "escape", "command": "editor.closeTestPeek", | |
"when": "testing.isInPeek && !config.editor.stablePeek || testing.isPeekVisible && !config.editor.stablePeek" }, |
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
export const defaultStyles = { | |
option: (provided, { isSelected, isDisabled, isFocused }) => ({ | |
...provided, | |
...fontStyles, | |
top: 0, | |
color: isSelected ? '#F5F5F5' : '#000', | |
padding: '7px 8px', | |
backgroundColor: isSelected ? '#000' : isFocused ? '#00000040' : '#F5F5F5', | |
'&:last-child': { | |
borderRadius: '0 0 5px 5px', |
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
#!/bin/bash | |
# Step 1: Installing Docker | |
# Update the package list | |
sudo apt update | |
# Install prerequisite packages | |
sudo apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common |
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
import pandas as pd | |
import json | |
# to detect duplicates | |
unique_key = 'id' | |
def check_duplicates(json_file): | |
# Read JSON file | |
with open(json_file, 'r') as file: | |
data = json.load(file) |