This file contains hidden or 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> | |
<div> | |
<foo /> | |
</div> | |
</template> | |
<script> | |
export const foo = { | |
render(createElement) { | |
return createElement('p', 'Foo!') |
This file contains hidden or 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 | |
namespace App\GraphQL; | |
use GraphQL\Type\Definition\ResolveInfo; | |
use Illuminate\Support\Facades\Validator; | |
use Nuwave\Lighthouse\Support\Contracts\GraphQLContext; | |
class Request | |
{ |
This file contains hidden or 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 {getRepository} from 'typeorm'; | |
import {ValidationArguments, ValidatorConstraint, ValidatorConstraintInterface} from "class-validator"; | |
@ValidatorConstraint({name: "exists", async: true}) | |
export class IsExisting implements ValidatorConstraintInterface { | |
async validate(value: any, args: ValidationArguments) { | |
return 0 !== await getRepository(args.constraints[0]).count({ | |
where: { | |
[args.constraints[1]]: value |
This file contains hidden or 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 path = require('path') | |
const publicDir = 'assets/html' | |
module.exports = { | |
chainWebpack: config => { | |
config | |
.plugin('html') | |
.tap(configs => { | |
configs[0].template = path.resolve(publicDir + '/index.html'); |
This file contains hidden or 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
#!/usr/bin/php | |
<?php | |
function parseInput() { | |
$in = fopen('php://stdin', 'r'); | |
$result = array(); | |
while($line = fgetcsv($in, 0, "\t")) { | |
$result[] = $line; | |
} | |
fclose($in); |