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
SELECT | |
relname table_name, | |
idx_scan index_scan, | |
seq_scan table_scan, | |
100*idx_scan / (seq_scan + idx_scan) index_usage, | |
n_live_tup rows_in_table | |
FROM | |
pg_stat_user_tables | |
WHERE | |
seq_scan + idx_scan > 0 and 100 * idx_scan / (seq_scan + idx_scan) < 95 and |
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
if [ $# -ne 2 ] | |
then | |
echo "No arguments supplied" | |
echo "usage: $0 <tag> <sha>" | |
exit 1 | |
fi | |
for dist in $(aws cloudfront list-distributions | jq -r ".DistributionList.Items[].ARN") | |
do | |
if [ "$(aws cloudfront list-tags-for-resource --resource $dist | jq -r ".Tags.Items[].Value")" == "$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
import i18n from 'i18next'; | |
import Fetch from 'i18next-fetch-backend'; | |
import React from 'react'; | |
import { useRouter } from 'next/router'; | |
import hoistNonReactStatics from 'hoist-non-react-statics'; | |
import { I18nextProvider } from 'react-i18next'; | |
import type { AppProps } from 'next/app'; | |
import { i18n as I18NextClient } from 'i18next'; | |
import { defaultLanguage } from '../services/i18n/language'; |
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 fetch from 'node-fetch'; | |
function setUpQuery(url) { | |
const api = 'https://www.googleapis.com/pagespeedonline/v5/runPagespeed'; | |
const parameters = { | |
url: encodeURIComponent(url) | |
}; | |
let query = `${api}?`; | |
for (let key in parameters) { | |
query += `${key}=${parameters[key]}`; |
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 { useEffect } from 'react'; | |
export default (ref: any, shouldDisable = true) => { | |
useEffect((): any => { | |
if (!shouldDisable) return null; | |
const element = ref.current.querySelector('.bw-allow-scroll'); | |
if (element) { | |
element.ontouchmove = (e: Event) => { | |
e.stopPropagation(); | |
}; |
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 {noop} from 'lodash' | |
const describeWrapper = (context, describe, before = noop, after = noop) => (...args) => { | |
const [_, impl, options] = args | |
args[1] = function(...descArgs) { | |
before.call(this, context, options) | |
impl.apply(this, [...descArgs, context]) | |
after.call(this, context, options) | |
} |
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 { PolymerElement } from '@polymer/polymer/polymer-element.js'; | |
export class PolymerWordCount extends PolymerElement { | |
constructor() { | |
super(); | |
} | |
static get is() { | |
return 'polymer-word-count'; | |
} |
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
<dom-module id='polymer-word-count'> | |
<template> | |
<style> | |
.title { | |
font-weight: bolder; | |
} | |
.log { | |
background: #aaa; | |
} | |
.word-count { |
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 './word-count/word-count'; | |
import { observable } from 'mobx'; | |
import { observer } from 'mobx-react'; | |
import * as React from 'react'; | |
import * as ReactDOM from 'react-dom'; | |
declare global { | |
namespace JSX { | |
interface IntrinsicElements { |
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
<template id="template-word-count"> | |
<style> | |
.title { | |
font-weight: bolder; | |
} | |
.log { | |
background: #aaa; | |
} | |
.word-count { | |
color: red; |
NewerOlder