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 | |
$FOLDER = $1 | |
for f in $FOLDER/*.html; do | |
echo "${f/.html/.js}" | |
git mv -- "$f" "${f/.html/.js}" | |
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
function shuffleArray(array) { | |
for (let i = array.length - 1; i > 0; i--) { | |
const j = Math.floor(Math.random() * (i + 1)); | |
[array[i], array[j]] = [array[j], array[i]]; | |
} | |
return array; | |
} |
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 axios from 'axios'; | |
const config = { | |
baseURL: 'https://chain-chess.glitch.me', | |
}; | |
const APIService = axios.create(config); | |
APIService.interceptors.request.use(request => { | |
const token = 'blah'; |
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 dates = [ | |
'2018-06-10', | |
'2013-03-21', | |
'2010-08-03', | |
'2016-02-05', | |
'2019-06-17', | |
]; | |
const toDate = d => new Date(d); | |
const extractYear = d => d.getFullYear(); |
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 arrayToMatrix(items) { | |
const matrixSize = Math.sqrt(items.length); | |
return new Array(matrixSize) | |
.fill(null) | |
.map(() => items.splice(0, matrixSize)); | |
} |
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
a:not([href*="{{yourdomain}}"])::after { | |
content: ""; | |
padding-right: 1em; | |
background-image: url("{{external-link-icon-url}}"); | |
background-size: .8em .8em; | |
background-position: center center; | |
background-repeat: no-repeat; | |
} |