Skip to content

Instantly share code, notes, and snippets.

View frederikduchi's full-sized avatar

Frederik Duchi frederikduchi

  • Baserow
  • Kortrijk
View GitHub Profile
import requests
base_url = 'https://api.scc.getbaserow.com/api/'
# Generate a token based on the e-mail and password of a user
token_endpoint = base_url + 'user/token-auth/'
token_response = requests.post(token_endpoint, data={
'email': 'scc-baserow@scc.losrios.edu',
'password': 'HereComesThePassword' # Load this from a .env file for security
}, timeout=5)
<div id="chartDiv" style="height:100%"></div>
<script src="https://code.jscharting.com/latest/jscharting.js">
</script>
<script>
let features = [];
@frederikduchi
frederikduchi / index.html
Created December 4, 2023 14:35
Strava HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Strava</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/style.css">
@frederikduchi
frederikduchi / lists.html
Created September 22, 2023 09:43
Nested lists
<h1>Devine curriculum</h1>
<ol>
<li>
<h2>Semester 1</h2>
<p>This runs from September 2023 until January 2024</p>
<p>It contains the following courses</p>
<ul>
<li>
<h3>Visual Design 1</h3>
<p>The coolest course of them all</p>
@frederikduchi
frederikduchi / flow.json
Created June 7, 2022 07:28
Goodmorning from Google
[
{
"id": "12799271bb573e4d",
"type": "tab",
"label": "Goodmorning from Google",
"disabled": false,
"info": "",
"env": []
},
{
[
{
"id": "9294c479ed090323",
"type": "tab",
"label": "IoT Weather station",
"disabled": false,
"info": "",
"env": []
},
{
[
{
"id": "9294c479ed090323",
"type": "tab",
"label": "IoT Weather station",
"disabled": false,
"info": "",
"env": []
},
{
@frederikduchi
frederikduchi / index.php
Created March 16, 2022 14:26
Avoiding error 403 when getting images fro external domain
<?php
/*
get the file and convert is to a base64 string
this is done in the PagesController
*/
$file_to_base = base64_encode(file_get_contents('https://cdn.sofifa.com/players/212/198/22_60.png'));
?>
<!DOCTYPE html>
<html lang="en">
if (basename(dirname(dirname(__FILE__))) != 'src') {
// do not show warnings or errors in production mode
ini_set('display_errors', false);
}else{
// show everything in development mode
ini_set('display_errors', true);
error_reporting(E_ALL);
}
<section class="content">
<form action="index.php?page=home" method="post" enctype="multipart/form-data">
<input type="hidden" name="action" value="add_user">
<input type="text" name="username" value="frederikdc">
<input type="file" name="picture" accept="image/png, image/jpeg, image/gif">
<input type="submit" value="upload image">
</form>
<ul>
<?php foreach($users as $user): ?>
<li>