Skip to content

Instantly share code, notes, and snippets.

View HoukasaurusRex's full-sized avatar
💨
force pushing to master

JT Houk HoukasaurusRex

💨
force pushing to master
View GitHub Profile
@HoukasaurusRex
HoukasaurusRex / dynamoose.mock.ts
Last active August 24, 2022 22:16
Dynamoose Mock Example
import { mockClient } from 'aws-sdk-client-mock'
import { PutItemCommand, GetItemCommand, QueryCommand, DeleteItemCommand } from '@aws-sdk/client-dynamodb'
import { marshall } from '@aws-sdk/util-dynamodb'
import * as dynamoose from 'dynamoose'
export type Item = Record<string, string | boolean | number>
export interface IMockDynamooseOptions {
item?: Item,
rejects?: boolean
@HoukasaurusRex
HoukasaurusRex / eb-rds.template.json
Created August 31, 2021 14:35
RDS cloudformation template generated from AWS CDK elasticbeanstalk module
{
"Resources": {
"ecommerceapprdsdbcredentialsdevelopment0F585BD5": {
"Type": "AWS::SecretsManager::Secret",
"Properties": {
"GenerateSecretString": {
"GenerateStringKey": "password",
"SecretStringTemplate": "{\"username\":\"username\"}"
},
"Name": "ecommerce-app-rds-db-credentials-development"
@HoukasaurusRex
HoukasaurusRex / jsonview-theme-nightowl.css
Created February 17, 2021 08:47
JSONView theme based on the Night Owl theme for VSCode
body {
white-space: pre;
font-family: consolas;
color: white;
background: #011627;
font-size: 12px;
}
.property {
color: #7fdbca;
@HoukasaurusRex
HoukasaurusRex / has_pair_with_sum.js
Last active February 9, 2021 06:22
JavaScript Interview Questions
// Google Interview Video: https://www.youtube.com/watch?v=XKu_SEDAykw
// Provided an array of numbers,
// find a pair of numbers that add up
// to a provided sum
// O(n) linear time complexity
const hasPairWithSum = (arr, sum) => {
const set = new Set(); // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
const len = arr.length; // Setting the arr.length to a variable here will prevent creating the variable for every iteration in the array
for (let i = 0; i < len; i++) {
@HoukasaurusRex
HoukasaurusRex / interview_cheatsheet.md
Created July 23, 2020 06:24
How to solve whiteboard interview questions

Interview Cheat Sheet

How to solve whiteboard interview questions

The 3 pillars of good code:

  1. Readable
  2. Time Complexity
  3. Space Complexity
@HoukasaurusRex
HoukasaurusRex / code_learning_resources.md
Last active November 24, 2021 07:10
A curated list of resources to help get over the initial hurdle of learning to code
@HoukasaurusRex
HoukasaurusRex / shields.md
Last active December 23, 2020 08:43
A collection of useful badges and shields for project READMEs

Project Shields

Below is a collection of shields and badges I've found useful in many of my projects in Github

CI/CD

@HoukasaurusRex
HoukasaurusRex / README.md
Last active December 23, 2020 10:06
A Pretty Good Readme

[![Netlify Status][netlify-shield]][netlify-url] [![Contributors][contributors-shield]][contributors-url] [![HitCount][hitcount-shield]][hitcount-url] [![Language grade: JavaScript][lgtm-shield]][lgtm-url] [![FOSSA Status][fossa-shield]][fossa-url] [![David Dependencies Status][dependencies-shield]][dependencies-url] [![License: MIT][license-shield]][license-url] [![LinkedIn][linkedin-shield]][linkedin-url] [![Twitter: HoukasaurusRex][twitter-shield]][twitter-url]

@HoukasaurusRex
HoukasaurusRex / hosts
Created March 17, 2020 08:12
Block Spotify Ads
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
@HoukasaurusRex
HoukasaurusRex / Code.gs
Created August 19, 2019 10:10
POST data to Google Sheets using Google Scripts
// Original: https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
// Usage
// 1. Enter sheet name where data is to be written below
var sheetName = 'Users'
// 2. Run > setup
//
// 3. Publish > Deploy as web app
// - enter Project Version name and click 'Save New Version'
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)