Skip to content

Instantly share code, notes, and snippets.

View dangolbeeker's full-sized avatar
🛰️
In Orbit

Scott Beeker dangolbeeker

🛰️
In Orbit
View GitHub Profile
@dangolbeeker
dangolbeeker / postgres-cheatsheet.md
Created January 19, 2022 22:28 — 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)

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@dangolbeeker
dangolbeeker / auth.js
Created October 11, 2021 18:40 — forked from panoply/auth.js
Lambda Shopify OAUTH
import { config } from 'dotenv'
import Shopify from 'shopify-api-node'
import cryptographer from '@brixtol/cryptographer'
config()
export const crypto = cryptographer(process.env.SHOPIFY_AUTH_SECRET)
/**
* Request Headers
@dangolbeeker
dangolbeeker / amp.d.ts
Last active May 1, 2021 23:23
AMP Typescript JSX Support Next.js
/// <reference types="next" />
/// <reference types="next/types/global" />
import * as React from 'react';
// why null ?
type _ANY = any;
type _ANYS = any;
declare module 'react' {
interface HTMLAttributes<T> {
// Add
autoscroll?: boolean;
# a million commits
for Y in {2018..2019}
do
mkdir $Y
cd $Y
for M in {05..10}
do
mkdir $M
cd $M
for D in {05..27}
@dangolbeeker
dangolbeeker / main.js
Created April 2, 2019 00:04
JS Assignment 13: Intro to Classes in Javascript created by dangolbeeker - https://repl.it/@dangolbeeker/JS-Assignment-13-Intro-to-Classes-in-Javascript
function ClassOne(name, pw, mail){
// Exercise One: In this exercise you will be creating your own class!
// You are currently in the class, you are given three strings, name, pw, and mail.
// You need to create three properties on this class.
// Those properties are: 'username', 'password', and 'email'
// Set the value of username to name,
// Set the value of password to pw,
// Set the value of email to mail
this.username = name;
this.password = pw;
@dangolbeeker
dangolbeeker / main.js
Created April 2, 2019 00:04
JS Assignment 14: The Class `prototype` created by dangolbeeker - https://repl.it/@dangolbeeker/JS-Assignment-14-The-Class-prototype
function exerciseOne(UserClass){
// Exercise One: In this exercise you are given a class called UserClass.
// You will be adding a method to the prototype called greeting
// This method will return the string: 'Hello, it is nice to meet you!'
// DO NOT create a new class or object
UserClass.prototype.greeting = function(){
return 'Hello, it is nice to meet you!';
};
// Please write your code in the lines above
return UserClass;
@dangolbeeker
dangolbeeker / main.js
Created April 2, 2019 00:03
JS Assignment 15: Intro to Callbacks created by dangolbeeker - https://repl.it/@dangolbeeker/JS-Assignment-15-Intro-to-Callbacks
// Exercise One: In this exercise you will be creating two functions.
// Function One: Will be called 'multiply'.
// This function will take two parameters, both numbers
// This function will return the two numbers multiplied together.
function multiply(num1, num2) {
return num1 * num2;
}
@dangolbeeker
dangolbeeker / main.js
Created April 2, 2019 00:00
JS Assignment 16: Using Callbacks in Array Methods created by dangolbeeker - https://repl.it/@dangolbeeker/JS-Assignment-16-Using-Callbacks-in-Array-Methods
function exerciseOne(names){
// Exercise One: In this exercise you will be given and array called names.
// Using the forEach method and a callback as it's only argument, console log
// each of the names.
names.forEach(function(name){
console.log(name);
});