Skip to content

Instantly share code, notes, and snippets.

View merelinguist's full-sized avatar
👩‍🌾

Kat merelinguist

👩‍🌾
View GitHub Profile
type GetSchemaASTInput = {
schema: string | undefined
}
const getSchemaAST = async ({schema}: GetSchemaASTInput) => {
if (!schema) {
return
}
const models = schema.match(/model [^{]*\{\s*([^}]*?)\s*}/g)
model [^{]*\{\s*([^}]*?)\s*}
import { BaseExecutor, executorArgument, getExecutorArgument } from './executor'
import * as fs from 'fs-extra'
import * as path from 'path'
import spawn from 'cross-spawn'
import { log } from '@blitzjs/server'
interface NpmPackage {
name: string
// defaults to latest published
version?: string
#[derive(Debug)]
struct StrongPassword<'r>(&'r str);
#[post("/projects", data = "<project_input>")]
fn create_project(project_input: Json<lib::Project>) -> Result<Json<lib::Project>, Status> {
let projects = lib::get_projects();
for project in projects {
if project.id == project_input.id || project.path == project_input.path {
return Err(Status::Conflict);
@merelinguist
merelinguist / getStreamLocation.ts
Created May 17, 2020 19:10
Blitz child_process
import {homedir} from 'os'
import {join} from 'path'
export const getStreamLocation = (id: string, type: string) => join(homedir(), '.blitz', `${id}-${type}.txt`)
import chalk from 'chalk'
export const withCaret = (str: string) => {
return `${chalk.gray('>')} ${str}`
}
export const withCheck = (str: string) => {
return `${chalk.green('✔')} ${str}`
}
.cells div::before {
content: "";
padding-bottom: 100%;
display: inline-block;
vertical-align: top;
}
import Link from "next/link";
import { useRef } from "react";
import { MouseEvent } from "react";
import { Header } from "../components/Header";
import { Main } from "../components/Main";
export default () => {
const boardRef = useRef<HTMLDivElement>(null);
const handleClick = (e: MouseEvent<HTMLDivElement>) => {
wOFFnÿdFFTMm‰|,[$GDEF`¿cä
” eGPOSbP înR§"^GSUBa$+b3ÎÒOS/2 N`h©©"cmap†û˙öä[÷cvt
DAÄ/Éwfpgm@p
m=é|gasp`∏glyfxL‰ôpü1headî66
hheaà $∑ hmtx\D÷Îê"[loca
àÓÓ∞ç†maxpÏ cxname\\€UËpost^lJ2
Ä~4prep ∞í£œ0iA$ß}_<ıË”¡!Õ‘F†0˛`ˇ1gÆxúc`d``~˚flÇÅÅ•˙_¬ˇñt†
¯
ï4∆ˆGö¨ã!fxúc`fícú¿¿ ¿¿‘≈¡¿¿‡
°„åuÄ|ê ∞3 ÅPÔp?^%!fÖˇ gôfl2úP``ò íc¸¬t H)00œì ”xúmì1hSQܡ{o´4öDh∞Ñ–T©µ
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.