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
import Image from '@components/Image'; | |
const Avatars = ({ users = [] }) => ( | |
<div className="flex -space-x-2 overflow-hidden"> | |
{users.map((user) => ( | |
<div className="flex flex-col items-center" key={user.name}> | |
<div className="relative inline-block h-20 w-20 rounded-full ring-4 ring-white overflow-hidden bg-gray-100"> | |
<Image | |
width={160} | |
height={160} |
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
// 🇧🇪 Checks if a date is a Belgian holiday | |
/* | |
The code below is not fully mine. | |
Everything is based on some snippets I found online (another github gist and something on stackoverflow if I am not mistaken). | |
I was in a hurry and forgot to keep track of my sources, my apologies. | |
*/ | |
// I did not bother translating all holiday names to English, was a bit easier to work with | |
// you could replace this with another date library or use native JS if bundle size is an issue | |
import { addDays, getYear, isSameDay } from 'date-fns'; |
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
// Tradetracker Direct Linking Redirect Page. | |
// https://sc.tradetracker.net/implementation/overview?f%5Btarget%5D=&f%5Bname%5D=General&f%5Bversion%5D=All&f%5BversionInfo%5D=Redirect | |
const crypto = require('crypto'); | |
// Set domain name on which the redirect-page runs, WITHOUT "www.". | |
const DOMAIN_NAME = ''; | |
// Set tracking group ID if provided by TradeTracker. | |
const TRACKING_GROUP_ID = ''; | |
// Don't change this line | |
const ONE_YEAR_IN_SECS = 31536000; |
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
<template> | |
<nav | |
v-if="showPagination" | |
class="pagination" | |
role="navigation" | |
aria-label="pagination" | |
> | |
<a | |
:disabled="currentPage < 2" | |
class="pagination-previous" |
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
const { send } = require('micro'); | |
const { handleErrors } = require('../../../lib/errors'); | |
const cors = require('../../../lib/cors')(); | |
const qs = require('micro-query'); | |
const mongo = require('../../../lib/mongo'); | |
const { ObjectId } = require('mongodb'); | |
const handler = async (req, res) => { | |
let { limit = 5, exclude = '' } = qs(req); |
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
{ | |
"name": "your-app", | |
"alias": "your-app.now.sh", | |
"Version": 2, | |
"builds": [ | |
{ "src": "index.js", "user": "@now/node-server", "config": { "maxLambdaSize": "50mb" } } | |
], | |
"routes": [{ "src": "/(.*)", "dest": "/index.js" }] | |
} |
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
const { MongoClient } = require('mongodb'); | |
const { promisify } = require('es6-promisify'); | |
let _connection; | |
const connect = () => { | |
if (!process.env.MONGO_URL) { | |
throw new Error(`Environment variable MONGO_URL must be set to use API.`); | |
} | |
return promisify(MongoClient.connect)(process.env.MONGO_URL, { |
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
## Create Booking | |
curl -X "POST" "https://[subdomein].bookfast.app/bookings" \ | |
-H 'x-api-key: SECRET' \ | |
-H 'Content-Type: application/json; charset=utf-8' \ | |
-d $'{ | |
"phone": "+314844908159", | |
"numberOfSpots": 1, | |
"firstName": "Fleur", | |
"coupon": "TEST", | |
"email": "[email protected]", |
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
<?php | |
// get cURL resource | |
$ch = curl_init(); | |
// set url | |
curl_setopt($ch, CURLOPT_URL, 'https://[jouw-subdomein].bookfast.app/bookings'); | |
// set method | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); |
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
const { send } = require('micro'); | |
const cors = require('micro-cors')(); | |
const { handleErrors } = require('errors'); | |
const mongo = require('mongo'); | |
const COLLECTION_NAME = 'games_v3'; | |
const handler = async (req, res) => { | |
const db = await mongo(); | |
const games = db.collection(COLLECTION_NAME); |
NewerOlder