Skip to content

Instantly share code, notes, and snippets.

@jaboulos
jaboulos / example-component.tsx
Created April 7, 2021 03:11
Jack Herrington React Hook with TS example
import { ReactNode } from 'react';
export interface HeadingProps {
title: string;
name?: string;
}
export const Heading = ({ title }: HeadingProps) => {
return <h3>{title}</h3>;
};
@jaboulos
jaboulos / function-examples.ts
Created April 2, 2021 23:35
Typescript Annotation Examples
// Takes 2 arguments (numbers), add them together and return the result
const add = (a: number, b: number): number => {
return;
};
// Named function example
function divide(a: number, b: number): number {
return a / b;
}
@jaboulos
jaboulos / postgres-cheatsheet.md
Created November 12, 2019 16:50 — 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)
@jaboulos
jaboulos / docker-help.md
Created May 21, 2019 14:26 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@jaboulos
jaboulos / store.js
Created May 7, 2019 23:24
redux store.js boiler plate code
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import rootReducer from './reducers'
const initialState = {};
const middleware = [thunk]
const store = createStore(rootReducer, initialState, compose(
applyMiddleware(...middleware),
@jaboulos
jaboulos / The Technical Interview Cheat Sheet.md
Created April 23, 2019 01:19 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@jaboulos
jaboulos / artillery2.txt
Last active March 16, 2019 01:19
stress proxy in development, 10,000 rps
//config file
config:
target: 'http://localhost:3001'
phases:
- duration: 60
arrivalRate: 100
scenarios:
- flow:
- get:
url: "/menu-users"
@jaboulos
jaboulos / integerPairs.js
Last active March 12, 2019 04:00
Integer pairs - toy problem
// integerPairs
// Design an algorithm to find all pairs of integers within an array which sum to a specified value.
// Input: array
// Output: array of pairs
// Time complexity: O(n)
// Space complexity: no constraints
// Example:
// Input: [3, 2, 8, 9, -1, 4, 5, 12, 1], 7
// Output: [ [ 3, 4 ], [ 2, 5 ], [ 8, -1 ] ] (order of pairs does not matter)
@jaboulos
jaboulos / amz_linux_git.md
Created March 7, 2019 03:40 — forked from rjhintz/amz_linux_git.md
AWS Linux: Git Install From Source

AWS Linux: Installing Git from Source

Method

Method:

  1. sudo yum update
  2. sudo yum install curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel
  3. sudo yum install asciidoc xmlto docbook2X
  4. sudo yum install gcc autoconf
  5. sudo ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
  6. wget https://github.com/git/git/archive/v2.8.4.zip