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
#!/bin/bash | |
stty -ixon # Disable ctrl-s and ctrl-q. | |
shopt -s autocd #Allows you to cd into directory merely by typing the directory name. | |
HISTSIZE= HISTFILESIZE= # Infinite history. | |
export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" | |
[ -f "$HOME/.shortcuts" ] && source "$HOME/.shortcuts" # Load shortcut aliases | |
# System Maintainence | |
alias mw="~/.config/mutt/mutt-wizard.sh" |
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
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
#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
Als haar adem plaats maakt voor de scherpe wind, stapt zij uit reflex naar achteren om zich te beschermen tegen de kou die de trein met zich meebrengt. | |
Ze zucht en slentert naar het rokershokje. | |
Ze rookt niet, maar het is overdekt en op een jongeman na is de ruimte leeg. | |
Dat verbaast haar niet, gezien het tijdstip. Als de piepende deur achter haar dichtvalt, kijkt de jongeman schichtig op. | |
Ze groeten elkaar en de jongen steekt een nieuwe sigaret op. | |
Zij sluit haar ogen en luistert naar het getrommel van de regen op het dak. | |
"Waarom doe je dat?" | |
"Wat doe ik?" | |
"Je hebt je ogen dicht." | |
"Ik luister naar de regen. Dat vind ik rustgevend." |
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 <EEPROM.h> | |
float tempC; | |
int reading; | |
int tempPin = 0; | |
int EAdress = 0; | |
void setup () { | |
analogReference(INTERNAL); | |
} |