Skip to content

Instantly share code, notes, and snippets.

View gabrielheinrich's full-sized avatar

Gabriel Heinrich gabrielheinrich

  • Holoplot
  • Berlin
View GitHub Profile
//Beispielcode
<template>
<q-card style="width: 100%">
<q-card-section>
<szenario-vergleich-table :szenario-list="state.szenarios" />
<div v-if="state.loading" class="row justify-center q-pt-lg">
<q-spinner size="lg" color="primary" />
</div>
</q-card-section>
@gabrielheinrich
gabrielheinrich / BookEditComposition.vue
Created December 19, 2022 14:53
BookEdit vue in Options and Composition API
<template>
<form v-if="book" @submit.prevent="onSubmit">
<label for="title">Title: </label>
<input type="text" name="title" id="title" v-model="book.title" />
<div v-if="errors.title">
{{ errors.title }}
</div>
<button type="submit">Save</button>
</form>
</template>
// 1. Try to name all eight Javascript types
// number
const num = 1;
// string
const str = "Hello";
// boolean
const bool = true; // or false
// null
const n = null;
// 1. Try to name all eight Javascript types
// 2. Which of these statements are true
0 == "0";
0 === "0";
null == undefined;
false == "false";
[] == "";
"" == false;
NaN == NaN;
@gabrielheinrich
gabrielheinrich / main.rs
Last active November 8, 2022 14:57
Replicache inspired realtime state sync in Rust
use std::collections::HashMap;
#[derive(Debug, Clone)]
struct User {
id: String,
name: String,
}
#[derive(Debug, Clone)]
struct Post {