Skip to content

Instantly share code, notes, and snippets.

@DreadBoy
DreadBoy / mecabricks-import.js
Last active June 9, 2023 07:24
Mecabricks - import all bricks in set
// ==UserScript==
// @name Mecabricks - import all bricks in set
// @namespace http://mecabricks.com
// @version 0.4
// @description Import all bricks from official set and lay them out.
// @author Dread_Boy
// @match https://www.mecabricks.com/en/workshop*
// @icon https://www.google.com/s2/favicons?sz=64&domain=mecabricks.com
// @grant GM_addStyle
// ==/UserScript==
// ==UserScript==
// @name Youtube Filters
// @namespace https://www.youtube.com/
// @version 0.6
// @description Allows you to hide watched videos and stories in subscription feed
// @match https://www.youtube.com/*
// @match https://www.youtube.com/*
// @copyright 2013+, Matic Kravina Leva
// @grant GM_addStyle
// ==/UserScript==
@DreadBoy
DreadBoy / marprom-data.json
Last active November 17, 2022 19:21
Marprom data
This file has been truncated, but you can view the full file.
{"timetable":[{"id":"192","name":"Maribor AP","routes":[{"id":"1","lines":[{"name":"Maribor AP - Tezenska Dobrava","times":["05:00","05:20","06:00","06:15","06:25","06:35","06:45","07:00","07:15","07:25","07:35","07:45","08:00","08:15","08:25","08:35","08:45","09:00","09:20","09:40","10:00","10:20","10:40","11:00","11:20","11:40","12:00","12:15","12:25","12:35","12:45","13:00","13:15","13:25","13:35","13:45","14:00","14:25","14:35","14:45","15:00","15:15","15:25","15:35","15:45","16:00","16:15","16:25","16:35","16:45","17:00","17:20","17:40","18:00","18:20","18:40","19:00","19:20","19:40","20:00","20:20","20:40","21:00","21:20","21:40","22:30","22:50"]},{"name":"Melje - Oreško nabrežje - Maribor AP - Tezenska Dobrava","times":["05:45","14:15","22:15"]},{"name":"Tezenska Dobrava - Maribor AP - Oreško nabrežje - Melje","times":["05:33","13:38","21:53"]}]},{"id":"2","lines":[{"name":"Maribor AP - Tabor - Kardeljeva Boršnikova","times":["05:20","06:20","07:40","08:20","09:40","10:20","11:00","11:40","12:20","13:
$ flutter build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
C:\Users\Dread\Github\pebble\build\app\tmp\kapt3\stubs\release\io\rebble\cobble\di\AppComponent.java:8: error: [Dagger/DependencyCycle] Found a d
@DreadBoy
DreadBoy / example.dart
Last active December 1, 2020 20:25
Global store pattern in Flutter
class News extends StatelessWidget {
const News({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: StoreLoader<List<Article>>(
provider: articles,
builder: (context, articles) => ListView.builder(
import 'package:flutter_test/flutter_test.dart';
void main() {
group('Dart', () {
test('compiler should recognise incorrect explicit type', () {
greet(String name) => name;
/// This would throw at compile time, that's expected and good
/// greet(007);
});
@DreadBoy
DreadBoy / state_notifier_test.dart
Created November 20, 2020 10:31
How to observe changes in StateNotifier correctly
import 'package:flutter_riverpod/all.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('StateNotifier', () {
test('should have correct starting value', () {
final container = ProviderContainer();
expect(container.read(testProvider.state), 'init');
});
@DreadBoy
DreadBoy / main.dart
Last active September 2, 2020 06:08
Higher-order functions in 3 different languages
int one() => 1;
T Function() passThrough1<T>(T Function() fun) => () => fun();
T Function(T Function() fun) passThrough2<T>() => (fun) => fun();
void main() async {
final result1 = passThrough1(one)(); // Can infer the type
final result2 = passThrough2()(one); // Can't infer the type ;(
}
// Write a function (in any language) that accepts an array of objects each containing a product name and list of locations (e.g. [“Paris”, “France”, “Europe”]), and returns an array of location objects with a list of names associated with each location. Paste a link to a private gist (gist.github.com) here.
type Product = {
name: string,
locations: string[],
};
const products: Product[] = [{name: 'France', locations: ['Paris', 'Chamonix']}]
function groupByLocation(products: Product[]) {
0.002 2019-07-05 14:07:26; Factorio 0.17.54 (build 46015, win64, alpha)
0.002 Operating system: Windows 10 (version 1809)
0.002 Program arguments: "C:\Program Files\Factorio\bin\x64\factorio.exe"
0.003 Read data path: C:/Program Files/Factorio/data
0.003 Write data path: C:/Users/maticl/AppData/Roaming/Factorio [215592/419530MB]
0.003 Binaries path: C:/Program Files/Factorio/bin
0.029 System info: [CPU: Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz, 4 cores, RAM: 14365/16270 MB, page: 25764/29983 MB, virtual: 4250/134217727 MB, extended virtual: 0 MB]
0.029 Display options: [FullScreen: 0] [VSync: 1] [UIScale: automatic (100.0%)] [Native DPI: 1] [Screen: 255] [Special: 0000] [Lang: en]
0.039 Available displays: 2
0.039 [0]: \\.\DISPLAY1 - Intel(R) HD Graphics 630 {0x05, [0,0], 1920x1080, 32bit, 60Hz}