- install tart: https://tart.run/
- download: https://channels.nixos.org/nixos-23.05/latest-nixos-minimal-aarch64-linux.iso
tart create --linux --disk-size <disk-size-in-gb> <vm-name>
tart run --rosetta="rosetta" --disk <path-to-iso> <vm-name>
- install: https://nixos.org/manual/nixos/stable/index.html#sec-installation-manual
- set up Rosetta: https://xyno.space/post/nixos-utm-rosetta
- have fun
Recently when refactoring a Vue 1.0 application, I utilized ES6 arrow functions to clean up the code and make things a bit more consistent before updating to Vue 2.0. Along the way I made a few mistakes and wanted to share the lessons I learned as well as offer a few conventions that I will be using in my Vue applications moving forward.
The best way to explain this is with an example so lets start there. I'm going to throw a rather large block of code at you here, but stick with me and we will move through it a piece at a time.
<script>
// require vue-resource...
new Vue({
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
# N, size of matrix. R, rank of data | |
N = 100 | |
R = 5 | |
# generate data | |
W_true = np.random.randn(N,R) | |
C_true = np.random.randn(R,N) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserUpdateView(AuthenticatorViewMixin, UpdateView): | |
model = User | |
template_name = 'manager/authenticator/user_list.html' | |
def get_form_class(self): | |
return modelformset_factory(User, extra=0) | |
def get_form_kwargs(self): | |
kwargs = super(UserUpdateView, self).get_form_kwargs() | |
kwargs['queryset'] = kwargs['instance'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- renames selected tracks | |
-- | |
-- from: | |
-- artist: "Various Artists" | |
-- name: "name-of-artist - name-of-track" | |
-- | |
-- to: | |
-- artist: "name-of-artist" | |
-- album artist: "Various Artists" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<title>FB Friend Locationer</title> | |
<style> | |
* {font-family: sans-serif;} | |
table th, table td{border: 1px solid #ccc; padding: 0 1em;} | |
</style> | |
<table id="loc"> | |
<thead> | |
<tr> | |
<th>Name</th><th>Current location</th> |