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
git clone https://github.com/otherusername/some-awesome-repo.git | |
# make changes, commit as needed | |
git remote set-url origin https://github.com/myusername/myforkedrepo.git | |
git push | |
~done~ |
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
redis-cli --scan --pattern "myprefix:*" | tr \\n \\0 | xargs -0 redis-cli unlink |
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
# recurisvely remove lines containing // @ts-check from all javascript files in current directory | |
find . -type f -name "*.js" -print0 | xargs -0 sed -i '' -e '/@ts-check/d' |
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
export const COUNTRY_CODES = { | |
AF: "Afghanistan", | |
AL: "Albania", | |
DZ: "Algeria", | |
AS: "American Samoa", | |
AD: "Andorra", | |
AO: "Angola", | |
AI: "Anguilla", | |
AQ: "Antarctica", | |
AG: "Antigua and Barbuda", |
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
#!/bash/bin | |
# Recursively find all occurences of X in all *.js files excluding node_modules | |
egrep -lir --include=*.js "X" --exclude-dir="node_modules" . |
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 { mergeWith, isNil } from "lodash" | |
var existing = { | |
a: 1, | |
b: 2, | |
d: { | |
a: 1, | |
b: [], | |
c: { test1: 123, test2: 321 } | |
}, |
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
export const assignDeep = (input, regex, replacer) => { | |
const json = JSON.stringify(input) | |
return JSON.parse(json, (k, v) => | |
typeof v === "string" && regex.test(k) ? replacer(v) : v | |
) | |
} | |
export const redactDeep = (input, regex) => | |
assignDeep(input, regex, () => "[REDACTED]") |
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
# https://download.geonames.org/export/zip/US.zip | |
mongoimport -d mydb -c zipcodes \ | |
--columnsHaveTypes --type tsv --file US.txt \ | |
--stopOnError --drop \ | |
--fields="countryCode.string(),postalCode.string(),placeName.string(),adminName1.string(),adminCode1.string(),adminName2.string(),adminCode2.string(),adminName3.string(),adminCode3.string(),latitude.double(),longitude.double(),accuracy.string()" |
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
# disable stackdriver logging in the cluster | |
gcloud beta container clusters update [CLUSTER_NAME] --logging-service none | |
# delete the label on the specific node | |
kubectl label nodes [NODE_NAME] beta.kubernetes.io/fluentd-ds-ready- | |
# apply config | |
kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes-engine-customize-fluentd/master/kubernetes/fluentd-configmap.yaml | |
# apply daemonset | |
kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes-engine-customize-fluentd/master/kubernetes/fluentd-daemonset.yaml |
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, { Component, PureComponent } from "react" | |
import PropTypes from "prop-types" | |
import { | |
StyleSheet, | |
View, | |
Text, | |
ViewPropTypes, | |
TouchableWithoutFeedback, | |
SectionList | |
} from "react-native" |