Skip to content

Instantly share code, notes, and snippets.

@giannissc
giannissc / xilem-architecture-overview.md
Last active April 23, 2024 06:15
Xilem Architecture Overview

There are four user levels to using a GUI framework:

  1. View composition
  2. Custom interactions
  3. Custom widgets
  4. Framework Development

xilem-architecture-overview

View composition

xilem-architecture-view-composition

@FruitieX
FruitieX / shell.nix
Created January 10, 2022 07:13
Fetches necessary dependencies for running Dioxus in desktop mode when using the Nix package manager
let
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/8c007b60731c07dd7a052cce508de3bb1ae849b4.tar.gz);
nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
rustStableChannel = (nixpkgs.rustChannels.stable).rust.override {
extensions = [
"rust-src"
"rust-analysis"
"rustfmt-preview"
"clippy-preview"
];
@slightfoot
slightfoot / sized_multi_child.dart
Created June 20, 2018 20:34
CustomSizedMultiChildLayout.. lets a child of CustomMultiChildLayout determine its size.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() => runApp(TestApp());
enum TestId {
First,
Second,
Third,
}
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active February 29, 2024 16:29
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@btroncone
btroncone / rxjs_operators_by_example.md
Last active July 16, 2023 14:57
RxJS 5 Operators By Example
@kevmoo
kevmoo / docker_log_last.dart
Created June 18, 2015 16:12
When using App Engine, docker containers are constantly restarting. Use this to keep a finger on the logs.
#!/usr/bin/env dart
import 'dart:async';
import 'dart:convert';
import 'dart:io';
const _splitter = const LineSplitter();
const _waitDuration = const Duration(milliseconds: 250);
const _green = '\u001b[32m';
FROM google/dart
WORKDIR /app
ADD pubspec.* /app/
RUN pub get
ADD . /app
RUN pub get --offline
CMD []
@kevmoo
kevmoo / pre-commit
Last active September 2, 2020 11:19
Pre-commit hook to format Dart code
# Inspired by https://robots.thoughtbot.com/use-git-hooks-to-automate-annoying-tasks
dart_files=$(git diff --cached --name-only --diff-filter=ACM | grep '.dart$')
[ -z "$dart_files" ] && exit 0
function checkfmt() {
unformatted=$(dartfmt -n $dart_files)
[ -z "$unformatted" ] && return 0
@trendels
trendels / rsync_daemon_over_ssh.md
Last active November 13, 2023 03:26
Rsync daemon mode over ssh

rsync daemon mode over ssh

There are several common ways to do rsync backups of hosts over ssh:

  1. As a non-root user. Upsides: very secure. Downside: cannot back up sensitive files.
  2. As root, with a public key. Downsides: Whoever has the private key has full root access to the host being backed up.
  3. As root, with a public key and a "forced command". Upsides: Restricts access to the server. Downsides: Requires either careful matching of rsync options (which might change over time), or "validator" scripts. Neither idea sounds very appealing to me.
  4. Running rsync in daemon mode on the host being backed up. Upsides: Lots of useful options, like read-only mode, running as a different user if required, server-side excludes/includes, etc. Downsides: Opens up a TCP port that has full filesystem read access and is hard to secure (Ideally you could make the rsync daemon use a unix socket instead, that could be secured by filesystem permissions, but I haven't found a way to do that).

Here is another option t