This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Basic settings | |
set nocompatible " Disable compatibility with old vi | |
filetype on " Enable filetype detection | |
filetype plugin on " Enable filetype-specific plugins | |
filetype indent on " Enable filetype-specific indentation | |
set tabstop=4 " Number of spaces a tab counts for | |
set shiftwidth=4 " Number of spaces for indentation | |
set expandtab " Use spaces instead of tabs | |
set autoindent " Auto indent new lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import requests | |
import glob | |
import time | |
import os | |
import hashlib | |
from urllib.request import urlretrieve | |
from PyPDF2 import PdfReader | |
from PyPDF2.errors import PdfReadError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- users in city without complete profile | |
with city as ( | |
select poly from sitter_area area where area.name = 'Cincinnati' | |
) | |
select u.id, u.first_name, u.last_name from sitter_user u | |
join sitter_babysitter b on b.user_id = u.id | |
join sitter_babysittersuccessprogress bsp on bsp.babysitter_id = b.id | |
join sitter_address a on a.user_id = u.id and ST_WITHIN(a.point, (select poly from city)) | |
where bsp.completed_profile is null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python-dispatch==0.2.0 | |
python-rtmidi==1.4.9 | |
websocket-client==1.3.3; python_version >= "3.7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 3.0" | |
} | |
} | |
} | |
provider "aws" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* My db is clean -- all the messages just say 'Test', this is my starting point */ | |
select * from sitter_message; | |
-- Threads longer than 1 message | |
select thread_id, l from ( | |
select message_thread.thread_id, jsonb_agg(message_thread.added_at order by message_thread.added_at) l from | |
( | |
with sitter_ids as (select user_id id from sitter_babysitter), | |
messages_w_context as ( | |
select m.*, (case when sender_id in (select id from sitter_ids) then true else false end) sender_is_sitter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
l | |
FROM ( | |
SELECT | |
jsonb_agg(score ORDER BY added_at) l | |
FROM | |
sitter_jobscorehistory | |
GROUP BY | |
ongoing_request_id) tab1 | |
WHERE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Given an array of people objects (where each person has a name and a number | |
# of pizza slices they're hungry for) and a number for the number of slices | |
# that the pizza can be sliced into, return the number of pizzas you need to | |
# buy. | |
import math | |
def gimme_pizza(people, slices_per_pie): | |
if people and slices_per_pie > 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Given an array of integers representing asteroids in a row, for each | |
# asteroid, the absolute value represents its size, and the sign represents its | |
# direction (positive = right, negative = left). Return the state of the | |
# asteroids after all collisions (assuming they are moving at the same speed). | |
# If two asteroids meet, the smaller one will explode. When they are the same | |
# size, they both explode. Asteroids moving in the same direction will never | |
# meet. | |
def asteroids(a): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
def stock_buy_sell(tst): | |
"""Given an array of numbers that represent stock prices (where each | |
number is the price for a certain day), find 2 days when you should buy | |
and sell your stock for the highest profit.""" | |
i = len(tst) - 1 | |
high_idx, low_idx = i, i |
NewerOlder