Skip to content

Instantly share code, notes, and snippets.

View Adekoreday's full-sized avatar
🎯
shipping code to production

Adekoreday

🎯
shipping code to production
View GitHub Profile
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 () => {
@Adekoreday
Adekoreday / myscript.sh
Created November 19, 2021 12:46 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@Adekoreday
Adekoreday / postgres-cheatsheet.md
Created August 10, 2019 11:05 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

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)
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);
@Adekoreday
Adekoreday / ioT-GPS-tracker.ino
Created May 19, 2019 12:22
code snippets for an iot-gps tracker
#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;