Skip to content

Instantly share code, notes, and snippets.

View tomialagbe's full-sized avatar

Tomi Alagbe tomialagbe

  • Tallinn, Estonia
View GitHub Profile
@tomialagbe
tomialagbe / content_blocker_tips.md
Created August 11, 2021 04:52 — forked from mackuba/content_blocker_tips.md
Tips for writing iOS content blockers - HelsinkiOS
  • read this first: https://www.webkit.org/blog/3476/content-blockers-first-look/
  • start by adding a new extension target to your iOS app of type “content blocker”
  • launch the app using the main target’s scheme + a call to SFContentBlockerManager.reloadContentBlockerWithIdentifier() with the extension’s id in application:didFinishLaunchingWithOptions: to auto-reload the blocker in development mode
  • if you don’t call reloadContentBlockerWithIdentifier() then you need to switch the blocker off and on again in the Safari settings (stop the app in Xcode if the switch is not moving)
  • use inspector from desktop Safari to inspect the Safari in the simulator in order to find specific things to block
  • things like periods in the url-filter regexp need to be escaped with double backslashes, e.g. facebook\\.net
  • if you use if-domain, it needs to be an array, even for one element
  • domain foo.com might not match www.foo.com even though I think it’s supposed to (UPDATE: They've changed it in one of
@tomialagbe
tomialagbe / httpQmlJson.qml
Created July 11, 2021 12:33 — forked from 40/httpQmlJson.qml
Simple HTTP JSON Request in QML
import bb.cascades 1.0
Page {
content: Container {
Label {
id: emailLabel
text: qsTr("Email")
}
Label {
id: urlLabel
@tomialagbe
tomialagbe / flutter_webcam_video.dart
Created June 19, 2021 20:16
Flutter web: Access Webcam Video
// ignore: avoid_web_libraries_in_flutter
import 'dart:html';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
void main() {
runApp(WebcamApp());
}
// ignore: avoid_web_libraries_in_flutter
import 'dart:html';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
void main() => runApp(WebcamApp());
class WebcamApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
@tomialagbe
tomialagbe / scrolling_panel.dart
Created January 16, 2021 07:53 — forked from slightfoot/scrolling_panel.dart
Scrolling Panel - by Simon Lightfoot - 20/10/2020
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@tomialagbe
tomialagbe / custom_debug_paint.dart
Created January 16, 2021 07:53 — forked from slightfoot/custom_debug_paint.dart
Custom Debug Paint - Paint custom graphics only in when show debug paint is enabled in the inspector - by Simon Lightfoot - 27/09/2020
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@tomialagbe
tomialagbe / order_progress.dart
Created January 16, 2021 07:53 — forked from slightfoot/order_progress.dart
Custom Order progress bar example - by Simon Lightfoot - 26/10/2020
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@tomialagbe
tomialagbe / expand_card.dart
Created January 16, 2021 07:52 — forked from slightfoot/expand_card.dart
Expading cards - by Simon Lightfoot 21/12/2020
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@tomialagbe
tomialagbe / defer_init.dart
Created January 16, 2021 07:50 — forked from slightfoot/defer_init.dart
Defer initialization of your UI based on a background service - by Simon Lightfoot - 29/12/2020 - Null Safe!
import 'dart:math' show Random;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show RendererBinding;
void main() {
runApp(MaterialApp(
home: Home(),
));
}
@tomialagbe
tomialagbe / main.dart
Created February 22, 2020 20:57 — forked from jogboms/main.dart
Neon Glow Graph
import 'dart:math' as math;
import 'dart:ui' as ui;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
const kBarWidth = 72.0;
const kBarSpacing = 4.0;
const kLabelHeight = 32.0;