Skip to content

Instantly share code, notes, and snippets.

View jessicabuzzelli's full-sized avatar

Jessica Buzzelli jessicabuzzelli

View GitHub Profile
@jessicabuzzelli
jessicabuzzelli / example-dbt-Dockerfile
Last active August 24, 2022 15:22
Example dbt Dockerfile using dbt Labs' base image
ARG DBT_VERSION=1.0.0
FROM fishtownanalytics/dbt:${DBT_VERSION}
ENV DBT_PROJECT_DIR=/usr/app/dbt && \
DBT_PROFILE_DIR=$DBT_PROJECT_DIR/profile
COPY . $DBT_PROJECT_DIR
RUN dbt deps
@jessicabuzzelli
jessicabuzzelli / simple-dbt-Dockerfile
Last active April 19, 2023 15:19
Simple dbt Dockerfile
FROM python:3.9-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends git
ENV DBT_PROJECT_DIR=/usr/app/dbt && \
DBT_PROFILES_DIR=$DBT_PROJECT_DIR/profile
COPY . $DBT_PROJECT_DIR
@jessicabuzzelli
jessicabuzzelli / add_intellij_launcher.sh
Last active January 9, 2021 03:01 — forked from rob-murray/add_intellij_launcer
Add Intellij launcher shortcut and icon for ubuntu
#!/bin/sh
cat > /usr/share/applications/intellij.desktop << EOF
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/opt/idea-IU-203.6682.168/bin/idea.png
Name[en_US]=IntelliJ Ultimate
Exec=/opt/idea-IU-203.6682.168/bin/idea.sh
@jessicabuzzelli
jessicabuzzelli / least-common-multiple.jl
Created October 5, 2020 15:49
Find least common mulitple of an array of integers using prime factorization
function prime_factorization(n::Int, primes::Array{Int}, factors=Dict{Int, Int}())
"""
n : number to factor
primes : a list of primes, ideally containing each prime up to n
factors : empty at initialization
return : dictionary of prime factors -> power (5 -> 2 = 5^2)
"""
if n == 1
return factors
@jessicabuzzelli
jessicabuzzelli / sieve-of-eratosthenes.jl
Created October 4, 2020 20:38
Find all primes within [1, n]
function sieve_of_eratosthenes(n::Int)
"""
n: upper bound on range to be checked for primes
return: list of all primes smaller or equal to n
"""
primes = [true for i in 1:n]
for i in 2:n
@jessicabuzzelli
jessicabuzzelli / quicksort.jl
Created September 25, 2020 16:41
Quick Sort in Julia.
function quicksort!(x::Array, a::Int, b::Int)
"""
x : array to be sorted
a : lower index of subarray (init as 1)
b : upper index of subarray (init as length(x))
"""
i, j = 1, length(x);
while i < b
@jessicabuzzelli
jessicabuzzelli / mergesort.jl
Created September 25, 2020 15:43
Merge Sort in Julia.
function mergesort(x::Array)
"""
x: 1-dimensional array to be sorted in ascending order
"""
n = length(x)
sorted_arr = []
if n > 1
k = floor(Int, n / 2)
@jessicabuzzelli
jessicabuzzelli / gurobi-sudoku.py
Created December 17, 2019 02:21
Sudoku solver using Gurobi Optimizer
from gurobipy import GRB, Model
from pandas import read_csv
model = Model('Sudoku')
model.setParam('OutputFlag', False) # suppress generic printouts
model.setObjective(0, GRB.MAXIMIZE) # arbitrary but required by solver
# problem data
n_rows = 6
@jessicabuzzelli
jessicabuzzelli / kmeans_numpy.py
Created April 30, 2019 02:52
KMeans clustering from scratch with NumPy.
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import imageio
@jessicabuzzelli
jessicabuzzelli / svd_numpy.py
Created April 30, 2019 02:39
Image reconstruction in NumPy using Singular Value Decomposition.
import os
from scipy import ndimage, misc
import numpy as np
# set images location #
folder = 'images_folder/'
# load images #