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' | |
| // Network Information API | |
| // NetworkInfo https://wicg.github.io/netinfo/ | |
| // https://caniuse.com/netinfo | |
| enum ConnectionType { | |
| 'bluetooth', | |
| 'cellular', | |
| 'ethernet', |
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
| // JavaScript | |
| // | |
| // Partial application | |
| // prefilling argument | |
| const add = (...args) => [...args].reduce((a, b) => a + b) | |
| const addMore = add.bind(undefined, 3, 5, 10) | |
| console.log('bind addMore(2)', addMore(2)) // bind addMore(2) 20 | |
| const mergeObject = (a, b) => Object.freeze({ |
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 function getRandomInt(min: number, max: number): number { | |
| min = Math.ceil(min) | |
| max = Math.floor(max) | |
| return Math.floor(Math.random() * (max - min) + min) | |
| } | |
| const getRandomRGBColors = (count = 16) => { | |
| const colors: [number, number, number][] = [] | |
| const ranges = [255, 192, 128, 64, 32] | |
| for (let i = 0; i < ranges.length; ) { |
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 | |
| # Variables | |
| NIGHTLY_DIR="$HOME/firefox-nightly" | |
| NIGHTLY_PROFILE_DIR="$HOME/.mozilla/firefox-nightly-profile" | |
| DOWNLOAD_URL="https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=en-US" | |
| DESKTOP_FILE="$HOME/.local/share/applications/firefox-nightly.desktop" | |
| BIN_DIR="$HOME/.local/bin" | |
| EXECUTABLE="$BIN_DIR/firefox-nightly" | |
| TEMP_FILE="$HOME/Downloads/firefox-nightly.tar.bz2" |
OlderNewer