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
// requires ES2020 for BigInt support | |
const digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
function toBase62(number) { | |
if (number === 0n) { | |
return '0'; | |
} | |
let result = ''; | |
let remaining = number; |
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 React from 'react'; | |
import styled from 'styled-components'; | |
const Relative = styled.div` | |
position: relative; | |
`; | |
const TextWidth = styled.div` | |
opacity: 0; | |
text-overflow: clip; |
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 _ from 'lodash'; | |
/** | |
* The passed list of environment variables will be removed from the nodejs | |
* instance of webpack.DefinePlugin, so they can be resolved dynamically at | |
* runtime. | |
* @example | |
* // Include this in the plugins array exported by razzle.config.js | |
* const nodeRuntimeVarsPlugin = createRazzlePluginNodeRuntimeVars('PORT', 'HOST'); | |
* @param {String} ...nodeRuntimeVars |
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
# HOWTO: paste the contents of this file into your ~/.bash_profile or ~/.bashrc file | |
nvm_link_abs() { | |
# usage: nvm_link_abs <package_name> | |
if [ ! -d node_modules ]; then | |
echo "nvm_link_abs: you must be within your project's base directory for this script to work!" | |
return 1 | |
fi | |
npm link "$1" | |
local temp_link_target="$(readlink "node_modules/$1")" |
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 | |
permitted_file_extensions="mov|mp4|m4v|mpg|mpeg|m2v|mp2|ite|aac|m4a|m4b|m4p|mp3|caf|aiff|aif|aifc|au|sd2|wav|snd|amr|3ga" | |
eval "active_library="$(defaults read com.apple.iApps iTunesRecentDatabases) | |
printf -v active_library '%b' "${active_library[0]//%/\\x}" | |
active_library="${active_library#file://localhost}" | |
if [[ ! -e "$active_library" ]]; then | |
exit 1 | |
fi |