Skip to content

Instantly share code, notes, and snippets.

ingredients = db.Table('ingredients',
db.Column('ingredient_id', db.Integer, db.ForeignKey('ingredient.id')),
db.Column('recipe_id', db.Integer, db.ForeignKey('recipe.id'))
)
class Recipe(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(255))
descr = db.Column(db.Text)
steps = db.Column(db.PickleType)
@FMJansen
FMJansen / clock_emoji.php
Last active January 8, 2018 10:57
PHP function which returns the clock emoji with the time closest to the given datetime object.
<?php
/**
* Returns the clock emoji with the time closest to the given datetime object.
*
* @param DateTime $datetime The time
* @return string $emoji The appropriate clock emoji
*/
function clock_emoji($datetime) {
/* ===================================== */
/* ============ DEFINITIONS ============ */
/* ===================================== */
/* ----------------- */
/* Definitions: pins */
/* ----------------- */
#define pumpPin 5
#define pressureSensorPin A0
#define resetPin 4
<?php
$lassie_event = Lassie::getModel('event_model', 'get_open_events', array('public_only' => false) );
// returns
// stdClass Object ( [27] => stdClass Object ( [id] => 27 [active] => 1 [name] => Speciaalbier-Kafee [open_date] => 2019-05-31 00:00:00 [start_date] => ... (etc.)
$lassie_event = Lassie::getModel('event_model', 'get_event_by_id', array('id' => 27) );
// returns
// stdClass Object ( [classname] => ReflectionException [message] => Internal error: Failed to retrieve the default value ) [status_code] => 500 )
@FMJansen
FMJansen / keybase.md
Created September 12, 2019 17:36
Keybase proof

Keybase proof

I hereby claim:

  • I am fmjansen on github.
  • I am fmjansen (https://keybase.io/fmjansen) on keybase.
  • I have a public key whose fingerprint is 4C12 E682 ACAD 21B1 61A8 AC18 F864 DF08 E4F0 9E58

To claim this, I am signing this object:

@FMJansen
FMJansen / book-room.js
Last active September 30, 2019 09:57
This function is called on the booking/calendar page.
(function($) {
$(function() {
$('form.cart').submit(function() {
parent.calendarSubmittedInWindow(window);
window.parent.postMessage("https://sherlocked.nl/checkout/");
});
});
})(jQuery);
@FMJansen
FMJansen / rooms.js
Created September 28, 2019 11:27
This function is called on the page containing the iframe with the booking/calendar page.
(function ($) {
var locationInterval,
previousLocation;
window.calendarSubmittedInWindow = function (externalWindow) {
if (locationInterval) {
clearInterval(locationInterval);
locationInterval = undefined;
}
@FMJansen
FMJansen / index.html
Last active May 4, 2020 16:09
Tips EJW code :D
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Eerstejaarsweekend 2020</title>
<link rel="shortcut icon" href="./Images/Logo.png"/> <!-- je hebt hier een ‘trailing slash’ (de / voor >), die hoeft niet -->
<meta charset="utf-8"> <!-- deze is dubbel! -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="./main.css">
{
"things": [
{
"descriptor": "Japanese jazz",
"title": "Early Summer - 福居良",
"type": "thing song",
"url": "https://open.spotify.com/track/3ven4ZKSspshBwiLMMibEa"
},
{
"descriptor": "Japanese jazz",