Vue

A bunch of (scattered) tips and resources as I experiment with Vue. Basics: General wisdom Anatomy Eventhandling Watchers Computed props Components: Components Props Lifecycle hooks Emitting events Slots Fetching Data: Calling APIs in hooks Unique identifiers Styling Components: Global vs scoped styles CSS modules CSS v-bind Composition API: Composition API Reactive references script setup Composables Routing and Deployment: Vue Router History Dynamic routes Deployment Advanced: Pre-processors Pinia State Management Overview What is Vue? an open-source model–view–viewmodel front end JavaScript framework for building user interfaces and single-page applications, created by Evan You Helpful resouces: Read the offical docs Examples Vue cheat sheet Awesome Vue Vue.js devtools Volar VSCode extension Built-in Directives General wisdom It’s best to stick to conventions of the web and use camelCase in your script and kebab-case in your template Don’t pass functions as props, instead emit events props couples components to each other, for broad or deep cross cutting state, level up to state management Test data sources: JSON Placeholder PokeAPI Anatomy Here is a bare bones vue app. There are literally 3 blocks for script, template (markup) and style: ...

March 2, 2023 · 15 min

Information Assurance

Kicking off the 2023 University year I continue my journey into the Cybersecurity Masters program with unit Infomation Assurance and Security run by Michael McGarity and Huadong Mo. Provides students with a deep understanding of the technical, management and organisational aspects of Information Assurance within a holistic legal and social framework. The course is essentially modelled off the CISSP certification, which dives into the following subjects: make a realistic assessment of the needs for information security in an organisation discuss the implications of security decisions on the organisation’s information systems understand the principles of writing secure code show an understanding of database and network security issues demonstrate an understanding of encryption techniques understand foundations of the tools and techniques in computer forensics show an appreciation of the commercial, legal and social context in which IT security is implemented apply knowledge gained to business and technical IA scenarios Intro Not a one size fits all approach. Too many factors and seemingling chaotic variables, such as risk appetites, country legislation, the business vertical (mining vs banking vs government), acceditation frameworks that apply to certain industries, tolerances, technology limitations, and so on. ...

March 4, 2023 · 4 min

Books

2023 To Kill a Mockingbird by Lee, Harper Own the Day, Own Your Life: Optimised practices for waking, working, learning, eating, training, playing, sleeping and sex by Marcus, Aubrey 2022 The Dream Machine by Waldrop, M. Mitchell Absolute FreeBSD by Lucas, Michael W. Deep Work: Rules for Focused Success in a Distracted World by Newport, Cal 2021 Revolution in The Valley: The Insanely Great Story of How the Mac Was Made by Hertzfeld, Andy Kingpin: How One Hacker Took Over the Billion-Dollar Cybercrime Underground by Poulsen, Kevin The New New Thing: A Silicon Valley Story by Lewis, Michael Ghost in the Wires: My Adventures as the World’s Most Wanted Hacker by Mitnick, Kevin D. Bonhoeffer: Pastor, Martyr, Prophet, Spy by Metaxas, Eric * 1984 by Orwell, George Atomic Habits: An Easy and Proven Way to Build Good Habits and Break Bad Ones by Clear, James * Vagabonding: An Uncommon Guide to the Art of Long-Term World Travel by Potts, Rolf American Kingpin: The Epic Hunt for the Criminal Mastermind behind the Silk Road Drugs Empire by Bilton, Nick * The God Delusion by Dawkins, Richard 2020 Into the Wild (Ebook) by Krakauer, Jon * The Last Wish (The Witcher, #0.5) by Sapkowski, Andrzej Do Androids Dream of Electric Sheep? by Dick, Philip K. Alan Turing: The Enigma by Hodges, Andrew 2019 Harry Potter and the Philosopher’s Stone (Harry Potter, #1) by Rowling, J.K. Ultralight Backpackin’ Tips: 153 Amazing & Inexpensive Tips for Extremely Lightweight Camping by Clelland, Mike * Turn The Ship Around! by Marquet, L. David 2018 Microserfs by Coupland, Douglas * Autobiography: The Story of My Experiments with Truth by Gandhi, Mahatma Influence: The Psychology of Persuasion by Cialdini, Robert B. * The Mythical Man-Month: Essays on Software Engineering by Brooks Jr., Frederick P. 2017 The Cuckoo’s Egg: Tracking a Spy Through the Maze of Computer Espionage by Stoll, Clifford Savaged by Systemd: an Erotic Unix Encounter by Lucas, Michael Warren

January 27, 2023 · 2 min

Kinetic workouts

Categorises the gym workout by these kinetic systems: Power (3 mins) Strength (5 mins) Endurance (8 mins) Cardio (10 mins) Durability (15 mins) Every 50 minute workout includes each of them. This is really just a catalogue of kettlebell and/or body weight exercises. Basic program 1 Cardio (10 mins) of choice run, bike, row, stair mill, jump jop Mobility (10 mins) circuit of: Kettlebell windmills (5 reps each side) Kettlebell halos (5 reps each side) variation options include lunges or squats Power (3 mins) Kettlebell sumo squat 6 sets of 10 secs on, 20 secs rest ...

December 27, 2022 · 2 min

8-bit CPU build

This material is based on the high quality build your own CPU guide by Ben Eater. Ben cites the SAP-1 CPU architecture as the design inspiration for the CPU, which originated from the book Digital Computer Electonics by Albert Paul Malvino. The SAP (Simple As Possible) computer has been designed for you, the beginner. Its purpose, to introduce the crucial ideas behind a CPUs operation without burying you in unnecessary detail. Architecture General Electonics Dirty power Resistors Capacitors Latch vs flip flop D flip flop The clock The registers Arithmetic and Logic Unit (ALU) Design Implementation Representing negative numbers - signing bit, 1’s and 2’s complement Ones complement Two complement Program Counter (PC) PC module problem 1: counter clearing PC module problem 2: dirty clock signal Output register Arduino Nano EEPROM programmer Binary to decimal 7-segment decoder Multiplexing four 7-segment displays with a single EEPROM Handy resources Architecture The SAP-1 defines a number of logical CPU modules which are capable of integrating to form a working CPU and ultimately computer. ...

July 12, 2020 · 19 min

Rust cheat sheet (2022)

Please refer to Don Bright’s original rust-lang-cheat-sheet which I based much of this content off, as I work through The Book. Rust in a nutshell Documentation Toolchain Mutability basic Types and variables Operators Run time errors, Crashing, panic, except, unwrap, Option, Result Printing loop, while and for Concurrency, parallel processing Functions and closures Unit tests, integration tests Documentation If, conditionals, patterns, match, control flow Ownership, Borrowing, References, Lifetimes Arrays, Slices, Ranges Structs Enums Collections, Key-value pairs, Sets Macros Little programs Guess a number Cool references Rust in a nutshell Syntax similar to C Ownership of memory enforced at compile time Statically linked Functional-ish, generic-ish, not so objecty Control flow using patterns, match keyword Packages: ‘cargo’ command, https://crates.io Testing: cargo test, #[test] Concurrency: ownership, mutability, channels, mutex, crossbeam + Rayon packages Auto formatter: rustfmt filename.rs Compiler engine: LLVM Raw pointers, low level: unsafe{} keyword Documentation rustup doc for offline docs! doc.rust-lang.org standard library, primitive types, standard macros docs.rs for package documentation Toolchain $ rustup.sh # install rust, see rust-lang.org for details $ cargo new myproj # start new executable project $ cargo new --bin myproj # as above $ cargo new --lib myproj # start new library project $ cd myproj # cd into the new directory $ ls -lR # list our skeleton of files src/main.rs # main.rs, has main() entry point Cargo.toml # Cargo.toml defines packaging $ $EDITOR Cargo.toml # add dependencies and other details $ cargo build # downloads dependencies + builds main.rs $ cargo build --release # release build $ cargo check # make sure code compiles, without binary outputs $ cargo update # ignore Cargo.lock and figure out latest versions $ cargo run # runs program created from main.rs $ cargo doc --open # local web based doc $ cargo test # runs tests (in parallel by default) $ cargo test -- --test-threads=1 # run tests one at a time $ cargo test -- --nocapture # run tests, show output $ cargo run --example fundemo -- --argtodemo # run example with argument $ rustc --explain E0384 # eli5 what an error code means Mutability basic let x = false; // all variable bindings are immutable by default x = true; // compile error: can't change an immutable binding let mut p = false; // "mut" designates a binding as mutable p = true; // ok, mutable binding can change; Types and variables Rust provide two compound types; arrays and tuples. ...

December 11, 2021 · 26 min

Neovim setup (2022 edition)

Updated: 2022-01-23 I finally (2007) bit the bullet and commited to learning a real text editor. Having muddled on and off with vi since the late 90s, decided on Vim. Once you break through its initial, steep, learning curve its truly life changing. Level up and become a text surgeon today. Vim is incredibly customisable. Its important to take the time to craft your own vimrc. Type :options to understand the various levers you can pull to make Vim your editor. Almost 15 years later, I’m still constantly fine tuning things. ...

April 16, 2007 · 12 min

PowerShell cheat sheet

Help and context Execution policy Operators Regex Flow Control Variables Functions Modules Module Management Good modules to run Filesystem Hashtables (Dictionary) Windows Management Instrumentation (WMI) Async Filesystem events Timers PowerShell drives Data (CRUD) management Damn handy A work in progress. Credits: https://gitlab.com/JamesHedges/notes/-/wikis/Powershell/PowerShell-Cheat-Sheet https://gist.github.com/pcgeek86/336e08d1a09e3dd1a8f0a30a9fe61c8a Help and context $PSVersionTable.PSVersion # what version Get-Command # list commands available Get-Command -Module Microsoft* # list commands exported from modules named Microsoft* Get-Command -Name *item # wildcard search commands Get-Help Get-Help -Name about_Variables Get-Help -Name Get-Command Get-Help -Name Get-Command -Parameter Module Execution policy Levels = {Restricted,Remote Signed,All Signed,Unrestricted} ...

May 8, 2022 · 5 min

A tour of FreeBSD in 2022

Why Handy resources Talks Factoids Things that feel different Software management and ports Ports patching init system coreutils Scheduling Block devices My setup NFS xorg dwm st powerd++ ntp fonts Why Mostly curiosity. I’ve been a GNU/Linux and free software enthuiatist since the late 90’s and that’s not about to change. More concrete reasons: GNU/Linux won the war. However… The Berkeley Software Distributions are family of open UNIX-like operating systems with lineage back to AT&T UNIX They come as complete and cohesive systems, not a distribution of disparate pieces The BSD license is wonderfully permissive Bill Joy (the father of Sun, BSD, vi, RISC) Marshall Kirk McKusick ZFS, DTrace and Clang It feels so damn neat, tidy and robust It wont be my daily driver, however it’s nice to be aware of what {Free,Open,Net}BSD each bring to the table Handy resources FreeBSD Handbook FreeBSD Porters Handbook FreeBSD Wiki Freshports the place for ports and most recent commits bsd-hardware.info papers.freebsd.org the collected works of the FreeBSD community as presented at various conferences and summits Talks Using boot environments at scale - by Allan Jude The ZFS Filesystem workshop - by Philip Paeps Factoids The term daemon comes from Greek mythology and represents an entity that is neither good nor evil, and which invisibly performs useful tasks. This is why the BSD mascot is the cheerful-looking daemon with sneakers and a pitchfork. Things that feel different My Linux biases are deep rooted. It’s so fascinating to learn how the BSD’s have gone about things differently. ...

April 17, 2022 · 5 min

My LaTeX, Pandoc and Makefile workflow for writing papers in 2022

Contents Install base Tex system Pandoc Author paper Create bibliography (BibTeX) Render the paper as PDF Use Git Resources LaTeX is a high-quality typesetting system; features are designed for the production of technical and scientific documentation. It’s the de-facto standard for the communication and publication of scientific documents, and available as free software. LaTeX is actually built on the TeX typesetting system created by the legendary Donald Knuth. LaTeX is nothing more than a series of TeX macros, providing ready made commands for common formatting and layout needs, such as section headings, footnotes, bibliographies and cross references. ...

May 26, 2019 · 5 min