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
module.exports = { | |
env: { | |
browser: true, | |
es6: true, | |
node: true, | |
}, | |
extends: ['eslint:recommended', 'plugin:react/recommended'], | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, |
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
{ | |
"extends": [ | |
"eslint:recommended", | |
"plugin:@typescript-eslint/recommended", | |
"plugin:@typescript-eslint/recommended-requiring-type-checking" | |
], | |
"env": { | |
"node": true, | |
"es6": true |
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
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 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 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 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 { 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 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
// 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 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 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 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
#!/bin/bash | |
echo "Updating package index..." | |
sudo apt-get update | |
echo "Installing required packages..." | |
sudo apt-get install -y ca-certificates curl | |
echo "Setting up Docker's GPG key..." | |
sudo install -m 0755 -d /etc/apt/keyrings |
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 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) |
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
#!/bin/bash | |
echo "Creating temporary directory for cri-dockerd..." | |
mkdir -p /tmp/cri-dockerd | |
echo "Downloading cri-dockerd binary for ARM64 architecture..." | |
wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.15/cri-dockerd-0.3.15.arm64.tgz | |
echo "Extracting cri-dockerd archive..." | |
tar xvf cri-dockerd-0.3.15.arm64.tgz |