See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
const SCROLL_UP = "up"; | |
const SCROLL_DOWN = "down"; | |
const useScrollDirection = ({ | |
initialDirection, | |
thresholdPixels, | |
off | |
} = {}) => { | |
const [scrollDir, setScrollDir] = useState(initialDirection); |
import * as React from 'react'; | |
import { theme } from './theme'; | |
import { ThemeProvider, createGlobalStyle } from './styled-components'; | |
const GlobalStyle = createGlobalStyle` | |
body { | |
font-family: Times New Roman; | |
} | |
`; |
#!/bin/sh | |
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d | |
# delete all evicted pods from all namespaces | |
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
# delete all containers in ImagePullBackOff state from all namespaces | |
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces |
// Require library | |
const xl = require('excel4node'); | |
// Create a new instance of a Workbook class | |
const wb = new xl.Workbook(); | |
// Add Worksheets to the workbook | |
const ws = wb.addWorksheet('Background Color'); | |
// create a style with solid background color |
// Component.js | |
const Component = props => ( | |
<MyContext.Consumer> | |
{(context) => ( | |
<Foo | |
bar={props.bar} | |
baz={context.baz} | |
/> | |
)} | |
</MyContext.Consumer> |
// To mock globally in all your tests, add to setupTestFrameworkScriptFile in config: | |
// https://facebook.github.io/jest/docs/en/configuration.html#setuptestframeworkscriptfile-string | |
jest.mock('moment', () => { | |
const moment = require.requireActual('moment-timezone'); | |
moment.tz.setDefault('America/Los_Angeles'); // Whatever timezone you want | |
return moment; | |
}); |
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod |
.cover { | |
position: fixed; | |
width: 100%; | |
top: 0; | |
left: 0; | |
z-index: 1100; /* just above title bar */ | |
transition: opacity 0.2s ease-in-out; | |
opacity: 1; | |
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#5dc1b2+0,1fbcd2+100 */ |
function asyncFunc(e) { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => resolve(e), e * 1000); | |
}); | |
} | |
const arr = [1, 2, 3]; | |
let final = []; | |
function workMyCollection(arr) { |