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 showPerformanceTimeLine() { | |
const timing = window.performance.timing; | |
const temp = []; | |
for (let i in performance.timing) { | |
const val = performance.timing[i]; | |
temp.push([i, val]); | |
} | |
const arr = temp.sort((a, b) => a[1] - b[1]); |
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 fs = require('fs'); | |
const readline = require('readline'); | |
const files = []; | |
let count = 1; | |
let store = new Set(); | |
const startFolder = './src/pages/'; | |
const goalFile = './src/locales/Order/en-US.js'; | |
// find all js files |
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 readline = require('readline'); | |
const fs = require('fs'); | |
const readInterface = readline.createInterface({ | |
input: fs.createReadStream('./messages.po'), | |
output: fs.createWriteStream('file.out'), | |
terminal: false, | |
console: false, | |
}); |
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 sadImageSrc from './sad.gif' | |
function TestImage () { | |
return ( | |
<div style={{ | |
width: '100%', | |
height: '100%', | |
display: 'flex', | |
flexDirection: 'column', |
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
img{ | |
width: auto; | |
height: auto; | |
max-width: 100%; | |
max-height: 100%; | |
} |
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
// remove all container | |
docker rm -f $(docker ps -aq) |
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
// start redis at localhost | |
docker run --name redis -p 6379:6379 -d redis |
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 formatDate(date) { | |
var d = new Date(date), | |
month = '' + (d.getMonth() + 1), | |
day = '' + d.getDate(), | |
year = d.getFullYear(); | |
if (month.length < 2) month = '0' + month; | |
if (day.length < 2) day = '0' + day; | |
return [year, month, day].join('-'); |