Skip to content

Instantly share code, notes, and snippets.

View thomasthaddeus's full-sized avatar
:dependabot:
Building things to make life easier

Thaddeus Thomas thomasthaddeus

:dependabot:
Building things to make life easier
View GitHub Profile
@thomasthaddeus
thomasthaddeus / streams.sqlite
Created July 25, 2022 18:36
Window Functions in SQL
SELECT
artist,
week,
streams_millions,
streams_millions - LAG(streams_millions, 1, streams_millions) OVER (
PARTITION BY artist
ORDER BY week
) AS 'streams_millions_change',
chart_position,
LAG(chart_position, 1, chart_position) OVER (
@thomasthaddeus
thomasthaddeus / purchases.sqlite
Created August 4, 2022 04:47
Queries to remember
SELECT purchase_id, DATE(purchase_date, '7 days')
FROM purchases;
SELECT STRFTIME('%H', purchase_date)
FROM purchases;
SELECT date, (CAST(high AS 'REAL') +
CAST(low as 'REAL')) / 2.0 AS 'average'
FROM weather
;
@thomasthaddeus
thomasthaddeus / sql_schema.sql
Created August 4, 2022 18:44
Key Validation for DB design
CREATE TABLE book (
title varchar(100),
isbn varchar(50) PRIMARY KEY,
pages integer,
price money,
description varchar(256),
publisher varchar(100)
);
CREATE TABLE chapter (
@thomasthaddeus
thomasthaddeus / analyzing_hotel_dbs_wpy.py
Created February 8, 2023 13:39
SQLite3 in Python and ways to analyze it
"""analyzing_hotel_dbs_wpy.py"""
# %% [markdown]
# # Analyzing Hotel Databases with Python
#
# Sleep Away Inc., a hotel corporation, has just hired you as a data analyst.
#
# 1. They would like you to analyze their most recent data about:
# - customers who cancelled their booking and
# - customers who did not cancel.
@thomasthaddeus
thomasthaddeus / index.html
Created February 15, 2023 06:49
Fashion week in New York Project taken from Codecademy
<!DOCTYPE html>
<html>
<head>
<title element="Everyday with Isa" />
</head>
<body>
<a href="#contact"><img
src="https://content.codecademy.com/courses/learn-html/elements-and-structure/profile.jpg"
/></a>
<h3>by Isabelle Rodriguez | 1 day ago</h3>
@thomasthaddeus
thomasthaddeus / tables.html
Last active February 17, 2023 11:35
Wine Festival Schedule The Aguillar Family is hosting their annual wine festival and they have asked you to build a web page for the event schedule! Use your knowledge of HTML to display a table to the attendees.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Aguillar Family Wine Festival</title>
<style>
body {
background-color: #242f44;
color: white;
font-family: 'Oswald', sans-serif;
0d 0a 0d 0a 3c 73 74 79 6c 65 3e 68 74 6d 6c 2c 20 62 6f 64 79 2c 20 64 69 76 2c 20 73 70 61 6e 2c 20 61 70 70 6c 65 74 2c 20 6f 62 6a 65 63 74 2c 20 68 31 2c 20 68 32 2c 20 68 33 2c 20 68 34 2c 20 68 35 2c 20 68 36 2c 20 70 2c 20 62 6c 6f 63 6b 71 75 6f 74 65 2c 20 70 72 65 2c 20 61 2c 20 61 62 62 72 2c 20 61 63 72 6f 6e 79 6d 2c 20 61 64 64 72 65 73 73 2c 20 62 69 67 2c 20 63 69 74 65 2c 20 63 6f 64 65 2c 20 64 65 6c 2c 20 64 66 6e 2c 20 65 6d 2c 20 69 6d 67 2c 20 69 6e 73 2c 20 6b 62 64 2c 20 71 2c 20 73 2c 20 73 61 6d 70 2c 20 73 6d 61 6c 6c 2c 20 73 74 72 69 6b 65 2c 20 73 74 72 6f 6e 67 2c 20 73 75 62 2c 20 73 75 70 2c 20 74 74 2c 20 76 61 72 2c 20 62 2c 20 75 2c 20 69 2c 20 63 65 6e 74 65 72 2c 20 64 6c 2c 20 64 74 2c 20 64 64 2c 20 6f 6c 2c 20 75 6c 2c 20 6c 69 2c 20 66 69 65 6c 64 73 65 74 2c 20 66 6f 72 6d 2c 20 6c 61 62 65 6c 2c 20 6c 65 67 65 6e 64 2c 20 74 61 62 6c 65 2c 20 63 61 70 74 69 6f 6e 2c 20 74 62 6f 64 79 2c 20 74 66 6f 6f 74 2c 20 74 68 65 61 64 2c 20 74 72 2c 20 74 68 2c 20 74 64 2c 2
123adana123456
123adana12345
123adana123456789
123adanapassword
123adanailoveyou
123adanaprincess
123adana1234567
123adanarockyou
123adana12345678
123adanaabc123
@thomasthaddeus
thomasthaddeus / _NLP_Preprocessor.py
Last active August 5, 2023 23:55
NLP gist for tokenizing parsing sentences
# 1. Import the necessary libraries and add five sentences from the data that will be used for training data.
# Use `Tokenizer` class from `keras.preprocessing.text` for tokenizing the sentences.
import string
import spacy
import gensim
import nltk
from nltk import ngrams
from nltk.corpus import stopwords
from nltk.tokenize import PunktSentenceTokenizer, word_tokenize
Name Landmass Zone Area Population Language Religion Bars Stripes Colors Red Green Blue Gold White Black Orange Mainhue Circles Crosses Saltires Quarters Sunstars Crescent Triangle Icon Animate Text Topleft Botright
Afghanistan 5 1 648 16 10 2 0 3 5 1 1 0 1 1 1 0 green 0 0 0 0 1 0 0 1 0 0 black green
Albania 3 1 29 3 6 6 0 0 3 1 0 0 1 0 1 0 red 0 0 0 0 1 0 0 0 1 0 red red
Algeria 4 1 2388 20 8 2 2 0 3 1 1 0 0 1 0 0 green 0 0 0 0 1 1 0 0 0 0 green white
American-Samoa 6 3 0 0 1 1 0 0 5 1 0 1 1 1 0 1 blue 0 0 0 0 0 0 1 1 1 0 blue red
Andorra 3 1 0 0 6 0 3 0 3 1 0 1 1 0 0 0 gold 0 0 0 0 0 0 0 0 0 0 blue red
Angola 4 2 1247 7 10 5 0 2 3 1 0 0 1 0 1 0 red 0 0 0 0 1 0 0 1 0 0 red black
Anguilla 1 4 0 0 1 1 0 1 3 0 0 1 0 1 0 1 white 0 0 0 0 0 0 0 0 1 0 white blue
Antigua-Barbuda 1 4 0 0 1 1 0 1 5 1 0 1 1 1 1 0 red 0 0 0 0 1 0 1 0 0 0 black red
Argentina 2 3 2777 28 2 0 0 3 2 0 0 1 0 1 0 0 blue 0 0 0 0 0 0 0 0 0 0 blue blue