sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| // Credit Ryan Carniato https://frontendmasters.com/courses/reactivity-solidjs/ | |
| let context = []; | |
| export function untrack(fn) { | |
| const prevContext = context; | |
| context = []; | |
| const res = fn(); | |
| context = prevContext; | |
| return res; |
| import type { V2_HtmlMetaDescriptor, V2_MetaFunction } from "@remix-run/node"; | |
| export const mergeMeta = ( | |
| overrideFn: V2_MetaFunction, | |
| appendFn?: V2_MetaFunction, | |
| ): V2_MetaFunction => { | |
| return arg => { | |
| // get meta from parent routes | |
| let mergedMeta = arg.matches.reduce((acc, match) => { | |
| return acc.concat(match.meta || []); |
Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.
Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.
Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.
Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.
I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.
But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.
Svelte is a language.
Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?
A few projects that have answered this question:
| import UIKit | |
| class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { | |
| @IBOutlet weak var tableView: UITableView! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| NSLayoutConstraint.activate([ | |
| tableView.topAnchor.constraint(equalTo: view.topAnchor), |
| // UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that | |
| // does not support `nomodule` is probably not being used anywhere. The code below is left | |
| // for posterity. | |
| /** | |
| * Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will | |
| * load <script nomodule> anyway. This snippet solve this problem, but only for script | |
| * tags that load external code, e.g.: <script nomodule src="nomodule.js"></script> | |
| * | |
| * Again: this will **not** prevent inline script, e.g.: |
| # Instructions for syncing a local folder with a remote FTP or SFTP server | |
| # The only requirement is homebrew. To get git-ftp: | |
| brew update && brew install git-ftp | |
| # Initialize a git repo in the directory you want to sync. Track all files, and commit them to your repo: | |
| git init | |
| git add -A && git commit -m "Committed all files" |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent