Skip to content

Instantly share code, notes, and snippets.

View masterwok's full-sized avatar
🍜
https://www.youtube.com/watch?v=u3CKgkyc7Qo

Jonathan Trowbridge masterwok

🍜
https://www.youtube.com/watch?v=u3CKgkyc7Qo
View GitHub Profile
Future<void> main() async {
// This must be invoked before reading the configuration.
WidgetsFlutterBinding.ensureInitialized();
final config = await Config.from("assets/config.yaml");
runApp(const FooApp());
}
import 'package:json_annotation/json_annotation.dart';
import 'proxy_config.dart';
import 'package:flutter/services.dart' show rootBundle;
import "package:yaml/yaml.dart";
import 'dart:convert';
part 'config.g.dart';
@JsonSerializable()
class Config {
import 'package:json_annotation/json_annotation.dart';
part 'proxy_config.g.dart';
@JsonSerializable()
class ProxyConfig {
final bool isEnabled;
final String host;
final int port;
dependencies:
json_annotation: ^4.0.1
flutter:
assets:
- assets/config.yaml
proxy:
isEnabled: false
host: "192.168.1.2"
port: 9090
@masterwok
masterwok / arch-linux-install
Created September 14, 2018 00:22 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap