Skip to content

Instantly share code, notes, and snippets.

@rootVIII
rootVIII / class_inheritance.verse
Created May 19, 2023 02:28
Verse Class Inheritance
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
pawn := class():
var TotalHP<private> : int = 100
var CurrentHP<private> : int = 100
@rootVIII
rootVIII / slice.verse
Last active November 27, 2023 01:11
Verse slice string and array
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Verse.org/Verse }
using { /UnrealEngine.com/Temporary/Diagnostics }
slice_class := class(creative_device):
Item1 : []string = array{"zero", "one", "two", "three", "four"}
Item2 : string = "string here"
@rootVIII
rootVIII / arrays_maps.verse
Created May 17, 2023 23:38
Verse arrays and maps
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Verse.org/Verse }
using { /UnrealEngine.com/Temporary/Diagnostics }
arrays_maps := class(creative_device):
Words : []string = array{"zero", "one", "two", "three", "four"}
var Result1 : []string = array{}
var Result2 : [string]string = map{
@rootVIII
rootVIII / eslintrc.js
Created November 30, 2022 23:03
Javascript my eslint
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: 'airbnb-base',
overrides: [
],
parserOptions: {
ecmaVersion: 'latest',
@rootVIII
rootVIII / growarray.c
Last active May 31, 2022 21:05
C Dynamically grow array
#include <stdio.h>
#include <stdlib.h>
#define CHUNK 32
void *my_realloc(void *buffer, size_t size) {
char *tmp = realloc(buffer, size);
if (!tmp) {
perror("realloc");
free(buffer);
@rootVIII
rootVIII / settings.json
Last active July 11, 2022 19:01
VSCODE My vscode settings.json
{
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.python"
@rootVIII
rootVIII / electron-builder.json
Last active May 30, 2022 16:10
Javascript Electron builder
// package.json must have similar to below
// in the "scripts" section:
// "scripts": {
// "start": "electron .",
// "pack": "electron-builder -m",
// "test": "echo \"Error: no test specified\" && exit 1"
// }
//
//
// Disable code signing:
@rootVIII
rootVIII / electron_notes.txt
Last active May 30, 2022 16:11
Javascript package-lock.json with Electron
# install into node_modules:
npm install electron --save-dev
npm install electron-builder --save-dev
{
"name": "glow_clock",
"version": "1.0.0",
"main": "main.js", // <-should be createWindow() electron starting point
"scripts": {
"start": "electron .",
@rootVIII
rootVIII / settings.json
Last active December 13, 2023 01:43
VSCode settings.json
{
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[python]": {
"editor.formatOnSave": true,
@rootVIII
rootVIII / vf.go
Last active May 30, 2022 16:13
Golang example variadic function
package main
import (
"fmt"
"strconv"
)
type example struct {
container []byte
}