Skip to content

Instantly share code, notes, and snippets.

@FBosler
FBosler / download_excel.py
Created August 25, 2019 17:00
Download an excel file from github
url = 'https://github.com/FBosler/Medium-Data-Extraction/blob/master/invoices.xlsx?raw=true'
res = requests.get(url, allow_redirects=True)
with open('invoices.xlsx','wb') as file:
file.write(res.content)
invoices = pd.read_excel('invoices.xlsx')
@FBosler
FBosler / download_csv.py
Created August 25, 2019 16:28
Download CSV File from github (the lazy way)
import requests
url = 'https://raw.githubusercontent.com/FBosler/Medium-Data-Extraction/master/sales_team.csv'
res = requests.get(url, allow_redirects=True)
with open('sales_team.csv','wb') as file:
file.write(res.content)
sales_team = pd.read_csv('sales_team.csv')
#Copyright 2022 Fabian Bosler
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
#Copyright 2022 Fabian Bosler
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
@FBosler
FBosler / SignupLoginModal.js
Last active January 19, 2023 11:19
Backend
import React, { useState } from "react";
import { Modal, Form, Col, Row } from "react-bootstrap";
import axios from "axios";
import DelegatedAuthList from "../DelegatedAuthList";
import {
PaddedContainer,
EmailSymbol,
PasswordSymbol,
ResponsiveHeader4,
@FBosler
FBosler / solution.py
Last active October 16, 2022 14:10
foobar_dodge_the_lasers
from decimal import Decimal, localcontext
def solution(s):
n = Decimal(s)
with localcontext() as ctx:
ctx.prec = 102
r = Decimal(2).sqrt()
s = Decimal(2) + Decimal(2).sqrt()
def solve(n):
service: fb-notification-service # Name of the service
useDotenv: true # We want to get the env variables from our .env
provider:
name: aws # provider we want to use
runtime: python3.8 # runtime we want to use // python3.9 does not work currently
memorySize: 128 # memory size, 128 is the lowest, scales performance
region: eu-central-1
stage: ${opt:stage, 'production'} # is used in the name
from keras_tqdm import TQDMNotebookCallback
batch_size = 32
history = model.fit_generator(
generator=training,
steps_per_epoch=training.samples // batch_size,
epochs=10,
callbacks=[TQDMNotebookCallback(leave_inner=True, leave_outer=True)],
validation_data=validation,
@FBosler
FBosler / static_scraping.py
Last active September 20, 2022 14:17
Download data from wikipedia
#Copyright 2022 Fabian Bosler
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.