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
Capitalized, short (50 chars or less) summary | |
More detailed explanatory text, if necessary. Wrap it to about 72 | |
characters or so. In some contexts, the first line is treated as the | |
subject of an email and the rest of the text as the body. The blank | |
line separating the summary from the body is critical (unless you omit | |
the body entirely); tools like rebase can get confused if you run the | |
two together. | |
Write your commit message in the imperative: "Fix bug" and not "Fixed bug" |
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 custom Jasmine reporter that logs slow specs. | |
const warnThresholdMs = 300; | |
const slowSpecsToPrint = 10; | |
function now() { | |
return (new Date()).getTime(); | |
} | |
const slowReporter = { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
echo '"days ago","tests"' > testCounts.csv | |
for i in $(seq 1 365); | |
do | |
git checkout "$(git rev-list -n 1 --before="$i days ago" origin/master)" | |
matches=$(\ | |
find spec/javascripts -name "*.js" -o -name "*.jsx" | \ |
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 | |
# Make the script fail on the first error encountered. | |
set -euo pipefail | |
# Create a temp folder that we can use to store files in. | |
if [ "$(uname -s)" = "Darwin" ]; then | |
tmp_dir=$(mktemp -d -t find-dead-modules.XXXXXXXX) | |
else | |
tmp_dir=$(mktemp -d --tmpdir find-dead-modules.XXXXXXXX) |
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
// Usage: | |
// | |
// function loader() { | |
// return new Promise((resolve) => { | |
// if (process.env.LAZY_LOAD) { | |
// require.ensure([], (require) => { | |
// resolve(require('./SomeComponent').default); | |
// }); | |
// } | |
// }); |
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
// Keep track of all DLS components: | |
const DLSComponents = {}; | |
// Keep track of all DLS examples: | |
const DLSExamples = {}; | |
function requireComponent(srcFile, requireFn) { | |
// Extract the component name from the file name: | |
let componentName = path.basename(srcFile, '.jsx'); | |
// Handle ComponentName/index.jsx: |
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 { storiesOf, action } from '@kadira/storybook'; | |
import { browserDLSExamples } from '../examples/allExamples'; | |
import fixtures from '../examples/fixtures'; | |
const { DLSExamples, DLSComponents } = browserDLSExamples(); | |
Object.entries(DLSExamples).forEach(([name, examplesFunc]) => { | |
let story = storiesOf(name, module); |
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/sh | |
# Find directories that only contain a single .eslintrc file. | |
# Adapted from https://superuser.com/a/727070 | |
# Enable double glob to find hidden files | |
shopt -s dotglob | |
# Loop through every subdirectory. | |
# Currently need to tweak this line and run it for every level of directory |