Skip to content

Instantly share code, notes, and snippets.

View Itsindigo's full-sized avatar
🐐

Matthew Bridges Itsindigo

🐐
View GitHub Profile
@Itsindigo
Itsindigo / Dockerfile
Last active May 1, 2018 20:45
Selenium Dockerfile
# THIS IS OUR LINUX VERSION
FROM alpine:edge
# A SPECIFIC VERSION OF FIREFOX WE NEEDED
ENV FIREFOX_VERSION 58.0.1-r2
# A PRE DOWNLOADED GECKODRIVER BINARY THAT WE STORE IN PROJECT
COPY geckodriver /usr/local/bin/
@Itsindigo
Itsindigo / config.yml
Last active April 26, 2018 19:09
Circle CI Boiler Plate
version: 2.0
jobs:
venv:
docker:
- image: eatsindigo/phoebus-online-build
steps:
- add_ssh_keys
- checkout
- attach_workspace:
at: .
import logging
import tracemalloc
tracemalloc.start(10)
logger = logging.getLogger(__name__)
class MemoryTracer:
def __init__(self):
@Itsindigo
Itsindigo / keybindings.json
Last active February 3, 2021 11:05
VS Code Keybindings
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "shift+alt+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+down",
"command": "-editor.action.moveLinesDownAction",
@Itsindigo
Itsindigo / docker-compose.yml
Created February 18, 2021 14:34
MySQL / Postgres Docker Container Init DBs Example
version: "3"
services:
a-postgres-container:
image: postgres:12
ports:
- ${DB_PORT_SOME_EXTERNAL_BIND:-5432}:5432
environment:
- POSTGRES_HOST=postgres
- POSTGRES_USER=my_user
@Itsindigo
Itsindigo / example.js
Last active February 22, 2022 16:40
How to partially mock a module with jest
import { functionWithDependencyThatNeedsMocking } from './service';
jest.mock('./service', () => {
...jest.requireActual('./service');
dependencyThatNeedsMocking: jest.fn()
})
it('should mock the call', () => {
const mySpy = jest.spyOn('./service', 'dependencyThatNeedsMocking')
@Itsindigo
Itsindigo / .bash
Created November 10, 2022 08:48
RemindMe Github Alias
# https://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
alias remindMe="git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
@Itsindigo
Itsindigo / main.js
Created May 16, 2024 19:15
315. max prime diff
let calculatedPrimes = new Set([2])
function isPrime(n) {
let prime = true
if (n === 1) {
return false
}
if (calculatedPrimes.has(n)) {
@Itsindigo
Itsindigo / main.js
Last active May 16, 2024 19:45
1716. money in leetcode bank
/**
* @param {number} n
* @return {number}
*/
var totalMoney = function(n) {
let total = 0
let numWeeks = Math.floor(n / 7)
let remainingDays = n % 7
for (let i=0; i < remainingDays; i++) {
import os
from dotenv import load_dotenv
from pydantic_settings import BaseSettings
dotenv_path = f"{os.getcwd()}/.env"
load_dotenv(dotenv_path)
class AppConfig(BaseSettings):