show dbs
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
Run Paginated Jobs | |
/** | |
* Cursor pagination is used here to guarantee efficiency as seen in this case mongoDB using async iterator | |
*/ | |
paginate: async function (schema, batchSize = 10) { | |
let result, cursor | |
const next = async () => { |
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
#! /bin/bash | |
# ECHO COMMAND | |
# echo Hello World! | |
# VARIABLES | |
# Uppercase by convention | |
# Letters, numbers, underscores | |
NAME="Bob" | |
# echo "My name is $NAME" |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
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
void loop(){ | |
while (ss.available() > 0) | |
if (gps.encode(ss.read())) | |
displayInfo(); | |
if (millis() > 5000 &&gps.charsProcessed() < 10) | |
{ | |
Serial.println(F("No GPS detected: check wiring.")); | |
while(true); |
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
#include "UbidotsMicroESP8266.h" | |
#include <SoftwareSerial.h> | |
#include <TinyGPS++.h> | |
#define TOKEN "BBFF-NZpbtqlig1f6DjMoC5lkov55BKAnXd" // Put here your Ubidots TOKEN | |
#define WIFISSID "mywifiname" // Put here your Wi-Fi SSID | |
#define PASSWORD "mypassword" // Put here your Wi-Fi password | |
Ubidotsclient(TOKEN); | |
TinyGPSPlusgps; |