npm install --save-dev babel-eslint eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks prettier
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 fetch from 'isomorphic-fetch'; | |
import { HttpAgent } from '@dfinity/agent'; | |
import { TRACING_CANISTER_ID, FACADE_CANISTER_ID } from '../config'; | |
import { createActor as createTracingActor } from './declarations/tracing'; | |
import { createActor as createFacadeActor } from './declarations/facade'; | |
import { custodianIdentity } from './identity'; | |
const agent = new HttpAgent({ | |
identity: custodianIdentity, |
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
server { | |
server_name grvty-relay.recheck.io; | |
set $upstream 127.0.0.1:4001; | |
location / { | |
proxy_pass_header Authorization; | |
proxy_pass http://$upstream; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
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 JWT_PATTERN = "(^[A-Za-z0-9-_]*\\.[A-Za-z0-9-_]*\\.[A-Za-z0-9-_]*\$)"; | |
function isJWT(data) { | |
return new RegExp(JWT_PATTERN).matches(data); | |
} |
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 handleFiles(files) { | |
let file = files[0]; | |
if (file === undefined) return; | |
let sizeDone = 0; | |
let counter = 0; | |
let dataHash = null; | |
let dataOriginalHash = null; | |
let chunkCount = parseInt(Math.ceil(fileSize / chunkSize)); |
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 csv = require("csvtojson"); | |
const { user } = require("./db/models") | |
let transaction = null; | |
let filePath = `${__dirname}/file.csv`; | |
const csvParseOptions = { | |
ignoreEmpty: true, | |
headers: ["field1", "field2", "field3", "field4", "field5"], | |
colParser: { |
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' | |
export const useColorMode = () => { | |
const [theme, setTheme] = useState( | |
window.localStorage.getItem('theme') || 'light', | |
) | |
const setNewTheme = (newTheme) => { | |
setTheme(newTheme) | |
window.localStorage.setItem('theme', newTheme) |
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 | |
set -euo pipefail | |
# Display message 'Setting up your Mac...' | |
echo "Setting up your Mac..." | |
sudo -v | |
# Installing XCodes cli tools... | |
if type xcode-select >&- && xpath=$( xcode-select --print-path ) && | |
test -d "${xpath}" && test -x "${xpath}" ; then |
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 data = "do shash'owania"; | |
var crypto = require('crypto'); | |
crypto.createHash('md5').update(data).digest("hex"); |
NewerOlder