I hereby claim:
- I am wardoost on github.
- I am wardoost (https://keybase.io/wardoost) on keybase.
- I have a public key ASAYajrkhu4cPDZQaYAULZdT9Fgn5YnZa4iOxK30AuyrGQo
To claim this, I am signing this object:
import * as functions from 'firebase-functions'; | |
import * as admin from 'firebase-admin'; | |
import fetch from 'node-fetch'; | |
const BATCH_LIMIT = 500; | |
const SUBCOLLECTION_NAME = 'subcollection'; // add your subcollection name | |
const DOC_UPDATE = { visible: true }; // change to your update that will be applied to all subcollection docs | |
export const updateAllDocs = functions.https.onRequest(async (req, res) => { | |
let query = admin |
I hereby claim:
To claim this, I am signing this object:
export default function promiseTimeout(ms, promise) { | |
// Create a promise that rejects in <ms> milliseconds | |
let timeout = new Promise((resolve, reject) => { | |
let id = setTimeout(() => { | |
clearTimeout(id); | |
reject('Timed out in '+ ms + 'ms.') | |
}, ms) | |
}) |
// From https://daverupert.com/2017/03/initial-impressions-of-css-grid/ | |
.container { | |
display: grid; | |
grid-template-columns: repeat(auto-fill, minmax(11em, 1fr)); | |
grid-gap: 2vw; | |
} |
// Hook extending the React useEffect hook to only run once | |
export function useEffectOnce(cb) { | |
const didRun = useRef(false); | |
useEffect(() => { | |
if (!didRun.current) { | |
cb(); | |
didRun.current = true; | |
} | |
}); |
#!/bin/bash | |
# Shifts creation and modified dates of all files in CWD that start with DSC by +12 hours | |
# chmod +x shift-dates.sh to make executable | |
for f in DSC*.*; do | |
ts="$(GetFileInfo -d "$f")" | |
e="$(date -j -f "%m/%d/%Y %H:%M:%S" "$ts" +%s)" | |
((o=60*60*12)) | |
((e+=o)) | |
nd="$(date -r $e "+%m/%d/%Y %H:%M:%S")" | |
SetFile -m "$nd" "$f" |
const add = (a, b) => a + b | |
add(5, 9) // 14 | |
// Higher-order function | |
const createAdd = a => b => add(a, b) | |
// Use HOF | |
const add3 = createAdd(3) | |
add3(8) // 11 |