bind q forward;sprint
bind z attack;duck
bind z +attack;+duck
export const AuthProvider: FunctionComponent<AuthProviderProps> = (props) => { | |
const { children } = props; | |
const [token, setToken] = useLocalStorage<string | null>({ | |
key: 'auth.token', | |
defaultValue: null, | |
getInitialValueInEffect: true, | |
}); | |
const [user, setUser] = useLocalStorage<UsersMeResponse | null>({ |
const simulateSlowHttpRequest = async (dummyData: string): Promise<string> => | |
new Promise<string>((resolve) => setTimeout(() => resolve(dummyData), 2000)); | |
const bootstrap = async (): Promise<void> => { | |
/** | |
* Test A | |
*/ | |
const startA = Date.now(); | |
const aA = await simulateSlowHttpRequest('a'); |
// modules/example/interfaces/listing.interface.ts | |
export interface ListingInterface { | |
names: string[]; | |
} | |
// modules/example/dtos/listing.dto.ts | |
export class ListingPayloadDto implements ListingInterface { | |
// class-validator validations | |
// @nestjs/swagger decorators | |
readonly names!: string[]; |
{ | |
"products": [ | |
{ | |
"uuid": "bd24626d-a078-403d-ae5e-6df5d9690908", | |
"name": "Minecraft Server (Modded)" | |
}, | |
{ | |
"uuid": "d8721919-a652-462b-95ac-b276db1412fb", | |
"name": "WordPress" | |
}, |
import { Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common'; | |
import { PrismaClient } from '@prisma/client'; | |
import knex from 'knex'; | |
import knexfile from './knexfile'; | |
@Injectable() | |
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy { | |
/** | |
* Waits for the database to be available. | |
*/ |
const bootstrap = async (): Promise<void> => { | |
// Do stuff | |
}); | |
bootstrap().catch((error: Error) => { | |
// Send error to sentry or Slack | |
console.error(error); | |
}); |
#!/bin/bash | |
WORKSPACE=$1 | |
log() { | |
echo "[$(date +"%D %T")] $1" >> "$WORKSPACE/deployment.log" | |
echo $1 | |
} | |
# Check if the workspace directory exists |
breakBlock = (block) => { | |
return new Promise((resolve, reject) => { | |
// @TODO: Equip the right tool | |
this.bot.dig(block, (err) => { | |
if (err) { | |
return reject(err); | |
} | |
return resolve(); |
FROM php:7.2.0-fpm-alpine3.7 | |
LABEL maintainer = "Kevin van der Burgt <kevin@zdev.com>" | |
# Change the workdirector | |
WORKDIR /var/www | |
# Copy the vendor listing files | |
COPY composer.* package* /var/www/ | |
# Copy the database files, the composer installer requires some parts to exists |