Install the Firebase Node modules:
$ npm install firebase firebase-admin --save| -- supabase/seed.sql | |
| -- | |
| -- create test users | |
| INSERT INTO | |
| auth.users ( | |
| instance_id, | |
| id, | |
| aud, | |
| role, | |
| email, |
| import { useReducer, useEffect } from 'react'; | |
| import { useSwipeable, SwipeableHandlers, EventData } from 'react-swipeable'; | |
| function previous(length: number, current: number) { | |
| return (current - 1 + length) % length; | |
| } | |
| function next(length: number, current: number) { | |
| return (current + 1) % length; | |
| } |
| /******* Android **********/ | |
| // See https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/FirebaseFirestore.html#setLoggingEnabled(boolean) | |
| FirebaseFirestore.setLoggingEnabled(true); | |
| /******* Server-side Java **********/ | |
| /** | |
| See https://medium.com/@hiranya911/logging-in-java-libraries-for-firebase-and-google-cloud-platform-f8742493b73f | |
| 1) Add the slf4j-simple binding to the application classpath | |
| 2) Set the -Dorg.slf4j.simpleLogger.defaultLogLevel=debug system property | |
| **/ |
| ## Delete a remote branch | |
| $ git push origin --delete <branch> # Git version 1.7.0 or newer | |
| $ git push origin :<branch> # Git versions older than 1.7.0 | |
| ## Delete a local branch | |
| $ git branch --delete <branch> | |
| $ git branch -d <branch> # Shorter version | |
| $ git branch -D <branch> # Force delete un-merged branches | |
| ## Delete a local remote-tracking branch |
| # first: | |
| lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
| sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
| # To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
| # go to /usr/local/lib and delete any node and node_modules | |
| cd /usr/local/lib | |
| sudo rm -rf node* |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // Determine if an element is in the visible viewport | |
| function isInViewport(element) { | |
| var rect = element.getBoundingClientRect(); | |
| var html = document.documentElement; | |
| return ( | |
| rect.top >= 0 && | |
| rect.left >= 0 && | |
| rect.bottom <= (window.innerHeight || html.clientHeight) && | |
| rect.right <= (window.innerWidth || html.clientWidth) | |
| ); |