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
# New repository | |
mkdir <repo> && cd <repo> | |
git init | |
git remote add –f <name> <url> | |
git config core.sparsecheckout true | |
echo some/dir/ >> .git/info/sparse-checkout | |
echo another/sub/tree >> .git/info/sparse-checkout | |
git pull <remote> <branch> | |
# Existing repository |
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
function StorageConfig(storeProvider) { | |
storeProvider.setStore(_determineStoreType()); | |
function _determineStoreType() { | |
if ((typeof localStorage === 'object') && _checkStorage(localStorage)) { | |
return 'localStorage'; | |
} else if ((typeof sessionStorage === 'object') && _checkStorage(sessionStorage)) { | |
return 'sessionStorage'; | |
} else { |
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
const cp = require('child_process'); | |
const clip = cp.exec('pbcopy', (_err, _stdout, _stderr) => {/* optionally do something */}); | |
clip.stdin.write(aString); | |
clip.stdin.end(() => process.stdout.write(`\rCopied ${aString.length} characters.\n`)); |
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
'use strict'; | |
const path = require('path'); | |
const fs = require('fs'); | |
const argv = process.argv.slice(2); | |
let [filename, prefix = ''] = argv; | |
if (prefix) { | |
prefix = `${prefix}_`; | |
} |
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
#!/usr/bin/env bash | |
adb shell input text $(pbpaste | sed -e 's/\(.\)/\\\1/g') |
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
(function () { | |
const headerRow = 'product_handle,state,rating,title,author,email,location,body,reply,created_at,replied_at'; | |
const escapeQuotes = s => s.replace('"', '\\"'); | |
const fillTemplate = ({ rating, title, author, body, created_at }) => `zenstone-professional-rapid-stone-warmer,published,${rating},"${escapeQuotes( | |
title)}","${escapeQuotes(author)}",amzcust@amz.com,,"${escapeQuotes(body)}",,"${escapeQuotes(created_at)}",`; | |
function parseReview(review) { | |
const ratingContainer = review.querySelector('[data-hook="review-star-rating"]'); | |
const starClass = Array.from(ratingContainer.classList).find(cls => cls.match(/a-star-(\d)/)); |
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
'use strict'; | |
const fs = require('fs'); | |
const readline = require('readline'); | |
const [, , filename] = process.argv; | |
if (!filename) { | |
throw Error('NO FILENAME SPECIFIED'); | |
} |
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
'use strict'; | |
const fs = require('fs'); | |
const readline = require('readline'); | |
const [, , filename] = process.argv; | |
if (!filename) { | |
throw Error('NO FILENAME SPECIFIED'); | |
} |
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
#!/usr/bin/env bash | |
FILE=$(realpath ${1}); | |
OLD=$2; | |
NEW=$3; | |
# Default fuzz: 25% | |
FUZZ=${4:-25}; |
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
#!/usr/bin/env bash | |
SRC=$(realpath ${1}) | |
DST=$(realpath ${2}) | |
find ${SRC} -type f -exec sh -c 'ln -s "{}" "'${DST}'/$(basename "{}")"' \; |
OlderNewer