Skip to content

Instantly share code, notes, and snippets.

// objects are "reference types" in C#
// and up until now we've only been working with
// "value types" like int, double, and bool
// ... except for our collections!
OurClass object1 = new OurClass(); // new reference
OurClass object2 = new OurClass(); // new reference
OurClass object3 = object1; // same reference as object1!
Console.WriteLine("object1 == object2:");
// while loops and do while loops are used
// to execute a block of code repeatedly.
// here is what a while loop looks like
// while (condition)
// {
// // code to execute
// }
// here is what a do while loop looks like
// dictionaries are used to store key value pairs
// - dictionaries are dynamic in size
// - we can get values from a dictionary
// - we can set values in a dictionary
// - we can add values to a dictionary
// - we can remove values from a dictionary
// - we can clear a dictionary
// - we can check if a dictionary contains a key
// some other properties:
// - the keys in a dictionary are unique
https://www.youtube.com/watch?v=hj3NNlTqIJg&list=PL8HkCX2C5h0XT3xWYn71TlsAAo0kizmVc&index=1&ab_channel=Codewithguillaume
add alias to root so you can use @ for a root
alias: {
"@": resolve(__dirname, "/"),
assets: "/<rootDir">/assets // use it as @/assets/...
},
add scss to nuxt.config
oninit: function () {
// set default filter on init
var orderStatus = SSIurlModul.getKey('ORDST');
if (!orderStatus) {
SSIurlModul.set("ORDST", "15,17,20,21,30,31,35,40,41,42,43");
};
},
oncomplete: function () {
// re-init filter to set default values
SSI.portal.init();
// https://ractive.js.org/api/#class-42
<div class-foo="isFoo">Adds "foo" if isFoo is truthy</div>
/* for example get el width */
// template
<p ref="appTitleRef">App title</p>
// script
const appTitleRef = ref(null)
onMounted(() => {
console.log(`The app title is ${ appTitleRef.value.offsetWidth } px wide`)
// script
const posts = ref([
{
id: 1,
title: 'post 1'
},
{
id: 2,
title: 'post 2'
}
/*
Computed properties are properties which are usually generated based on reactive data which are cached and only update when dependencies change.
*/
<template>
<p>{{ data.number }}</p>
<p>This number is {{ oddOrEven }}</p>
<button @click="newNumber(5)">Set the number<button/>
</template>
<template>
<h1>{{ title }}</h1>
<p>Edit title: </p>
<input v-model="title" type="text"/>
</template>
<script setup>
import { ref } from 'vue'