Skip to content

Instantly share code, notes, and snippets.

View martijnvdbrug's full-sized avatar

Martijn martijnvdbrug

View GitHub Profile
// Create an .env file with MOLLIE_APIKEY=YOUR_API_KEY, where YOUR_API_KEY is the api key of your test account
// Run this script with "node reproduce.js"
// Click the payment link in the console, pay for the order using iDeal
// See the error in your browser, and see in the Mollie dashboard that
const { createMollieClient } = require('@mollie/api-client');
const axios = require('axios');
(async () => {
@martijnvdbrug
martijnvdbrug / VuePage.vue
Last active October 4, 2022 09:12
Javascript variables and Vue props
<template>
<!-- Geef string door aan component. hetzelfde als standaard HTML attributen -->
<ProductCard
title="Dit wordt de titel"
/>
<!-- Geef een variabele door aan component -->
<ProductCard
:title="productName"
@martijnvdbrug
martijnvdbrug / Index.vue
Last active January 18, 2021 13:15
Gridsome Vendure hydration example
<template>
<div>
<div v-for="product in $page.Vendure.products.items" >
<img :src="product.featuredAsset.preview" class="thumbnail" />
<p :class="product.soldOut ? 'sold-out' : ''" class="product-title">{{ product.name }}</p>
<p :class="product.soldOut ? 'sold-out' : ''">{{ product.variants[0].priceWithTax }}</p>
<p v-if="product.soldOut">SOLD OUT</p>
</div>
</div>
</template>
@martijnvdbrug
martijnvdbrug / deploy.yml
Last active May 29, 2020 13:24
Example setup of GitHub action to deploy to multiple Google Cloud Run environments
name: Deploy
on:
push:
tags:
- '**'
env:
RUN_REGION: europe-west1
SERVICE_NAME: api
export class CompleteFlow implements Flow {
createConfiguration(): Promise<ProductConfiguration> {
// blijft hetzelfde?
return undefined;
}
getOptions(): Promise<ProductConfigurationOption> {
// is anders per flow
return undefined;
import {Injectable, Module} from '@nestjs/common';
import {NestFactory} from '@nestjs/core';
@Injectable()
export class SlowService {
constructor() {
console.log(`Created SlowService`);
}
}
import {Injectable, Module} from '@nestjs/common';
import {NestFactory} from '@nestjs/core';
@Injectable()
export class SlowService {
constructor() {
console.log(`Created SlowService`);
}
}
type Tesla {
id: ID!
model: String
edition: String
kwh: Int
range: Int
wheels: Wheel
}
type Wheel {
import {Module} from '@nestjs/common';
import {Tesla, Wheel} from '../../generated/graphql-types';
import shortid = require('shortid');
class IResolvers {
}
@Module({
providers: [],
exports: []
import {NestFactory} from '@nestjs/core';
import {INestApplicationContext} from '@nestjs/common';
import {AppModule} from './app/app.module';
import {ApolloServer} from 'apollo-server-cloud-functions';
export let context: INestApplicationContext;
export async function bootstrap(): Promise<any> {
context = await NestFactory.createApplicationContext(AppModule); // Initialize Nest without starting a server (because we're running in GCloud functions)
const app = context.get(AppModule);