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
movement1 = Movement("test1", "daily") | |
movement2 = Movement("test2", "daily") | |
for i in range(6): | |
user = User(f"user{i}", f"user{i}@email.com", "pass") | |
user.save_to_db() | |
users = User.query.all() | |
MUA = MovementUserAssociation | |
muas = [ |
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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Python: Flask", | |
"type": "python", | |
"request": "launch", |
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
from flask import Flask | |
def create_app(test_config=None): | |
# create and configure the app | |
app = Flask(__name__ ) | |
app.config.from_mapping( SECRET_KEY='12398fjnkcm,zxcjnd123n') | |
from . import auth | |
app.register_blueprint(auth.bp) |
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
version: '3.4' | |
services: | |
db: | |
restart: always | |
image: mysql:latest | |
command: --default-authentication-plugin=mysql_native_password | |
ports: | |
- '3306:3306' | |
environment: | |
MYSQL_ROOT_PASSWORD: root # TODO: Change this to something more secure on actual server! |
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
def for_each(iterable, function): | |
running = True | |
while running: | |
try: | |
a = next(iterable) | |
function(a) | |
except StopIteration: | |
running = False | |
def length(array): |
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
let mapleader ="," | |
call plug#begin('~/.config/nvim/plugged') | |
Plug 'scrooloose/nerdtree' | |
Plug 'junegunn/goyo.vim' | |
Plug 'tpope/vim-commentary' | |
Plug 'Townk/vim-autoclose' | |
Plug 'tpope/vim-surround' |
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 python | |
# credit for the function to https://stackoverflow.com/a/40843600 | |
# Commandline-ification by Robin A. Dorstijn | |
import re | |
import shutil | |
from tempfile import mkstemp | |
import click | |
@click.command() |
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
from sqlalchemy import create_engine | |
from sqlalchemy import Table, Column, Integer, ForeignKey, String | |
from sqlalchemy.orm import relationship, mapper, sessionmaker | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.ext.associationproxy import association_proxy | |
Base = declarative_base() | |
class User(Base): | |
__tablename__ = 'users' |
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
#include <DRV8825.h> | |
#include <HX711.h> | |
HX711 scale; | |
#define CAL_VAL 385 // Set the calibration value | |
#define DOUT A1 // DOUT -> pin A1 on arduino | |
#define SCK A0 // SCK -> pin A0 on arduino | |
#define STEP_SIZE 10 // Set the step size in milimeter |
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
user root; | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
default_type application/octet-stream; |