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
const WebPageTest = require('webpagetest'); | |
const util = require('util'); | |
const PUBLIC_URL = 'https://pomodoro-timer.app'; | |
const wpt = new WebPageTest('https://www.webpagetest.org/', process.env.WPT_API_KEY); | |
const isCI = process.env.CI; | |
const reportError = (err, id) => { | |
console.error('\x1b[31m%s\x1b[0m', ` |
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
// This optional code is used to register a service worker. | |
// register() is not called by default. | |
// This lets the app load faster on subsequent visits in production, and gives | |
// it offline capabilities. However, it also means that developers (and users) | |
// will only see deployed updates on subsequent visits to a page, after all the | |
// existing tabs open on the page have been closed, since previously cached | |
// resources are updated in the background. | |
// To learn more about the benefits of this model and instructions on how to |
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, { FC, useEffect } from 'react'; | |
import { Snackbar, Button } from '@material-ui/core'; | |
import * as serviceWorker from '../serviceWorker'; | |
const ServiceWorkerWrapper: FC = () => { | |
const [showReload, setShowReload] = React.useState(false); | |
const [waitingWorker, setWaitingWorker] = React.useState<ServiceWorker | null>(null); | |
const onSWUpdate = (registration: ServiceWorkerRegistration) => { | |
setShowReload(true); |
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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "cmd+0", | |
"command": "workbench.action.openLastEditorInGroup" | |
}, | |
{ | |
"key": "cmd+1", | |
"command": "workbench.action.openEditorAtIndex1" | |
}, |
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
<placeholder loadingdata="posts" height="300px"> | |
<ul> | |
<li ng-repeat="post in posts"> | |
{{post.title}} | |
</li> | |
</ul> | |
</placeholder> |
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
// Usage in pug/jade: | |
// placeholder(loadingdata="posts" height="300px") | |
// -> waits for 'posts' to be loaded | |
angularApp.directive('placeholder', function ($parse) { | |
function compile(element, attrs) { | |
element.children().attr('ng-show', attrs.loadingdata); | |
element.hide(); | |
var height = attrs.height; |
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
# Enable tab completion | |
source ~/git-completion.bash | |
# colors! | |
green="\[\033[0;32m\]" | |
blue="\[\033[0;34m\]" | |
purple="\[\033[0;35m\]" | |
red="\[\033[0;31m\]" | |
lightred="\[\033[1;31m\]" | |
reset="\[\033[0m\]" |