Skip to content

Instantly share code, notes, and snippets.

View psygo's full-sized avatar
🎯
focusing

Philippe Fanaro psygo

🎯
focusing
View GitHub Profile
@psygo
psygo / travis_flutter_integration_tests.yml
Last active April 18, 2020 17:30
Travis Flutter Integration Tests (Android Integration Tests not working | Code Coverage is not separated for this Mono Repo Setup)
# This is part of a custom mono repo setup I have.
# The folder structure is basically divided into an `app` and a `packages` folders.
# Codecov logging to codecov.io should be improved. Right now, it overwrites the previous one.
# Everything works except for the last stage, the Android Integration Tests.
# Working to make the Android tests work seems like a nightmare because of different
# versions incompatibility, something Apple does much better.
language: dart
env:
@psygo
psygo / gmail_signature.html
Last active August 25, 2023 18:13
Gmail Signature
<!-- Doesn't work for GMAIL sadly...
<script
type="text/javascript"
src="https://platform.linkedin.com/badges/js/profile.js"
async
defer>
</script> -->
<!-- Doesn't work for GMAIL either; no JS will work apparently
<script>

Font Recommendations

Chris Do's Recommendations

  1. Akzidenz Grotesque
    • Apparently, it has been rebranded as Helvetica.
  2. Avenir
  3. Avant Garde
  4. Bell Gothic
  5. Bodoni
@psygo
psygo / fix_textScaleFactor.dart
Created April 20, 2020 13:00
How to fix the `textScaleFactor` in Flutter
MaterialApp(
builder: (BuildContext context, Widget child){
final MediaQueryData data = MediaQuery.of(context);
return MediaQuery(
data: data.copyWith(
textScaleFactor: 1.0, // hard-coding the accessibility factor
),
child: child,
);
},
@psygo
psygo / inheritance_check_through_raw_classes.dart
Last active May 6, 2020 02:18
Dart Inheritance Check With `is`
main() {
print(ClassWithInheritance is BaseClass); // gives `false`
print(InterfaceImplementer is InterfaceExample); // gives `false`
}
class BaseClass {}
class ClassWithInheritance extends BaseClass {}
abstract class InterfaceExample {}
@psygo
psygo / const_factories.dart
Created May 6, 2020 02:17
An Example of Const Factories in Dart
// `const factory` basically only redirects the construction of the object.
// A `const` redirecting constructor must redirect to a `const` constructor.
main() {
const A a1 = A('hello');
print(a1);
const A a2 = A.redirected2('hello');
print(a2);
final A a3 = A('hello');
@psygo
psygo / customizable_exception.dart
Last active May 17, 2020 20:50
An exception template which you can extend (inheritance... since `Exceptions` typically have the same implementations)
import 'package:meta/meta.dart';
// import 'package:flutter/foundation.dart'; // Alternative for Flutter
@immutable
abstract class CustomizableException implements Exception {
static const String blankMsg = '';
static const String divider = ': ';
final String msg;
@psygo
psygo / customize_keyboard.sh
Created May 25, 2020 12:48
Customize Keyboard on Ubuntu (UNIX)
#!/bin/bash
KEYCODE="keycode"
xmodmap -e "${KEYCODE} 83 = Left" # KP_4
xmodmap -e "${KEYCODE} 80 = Up" # KP_8
xmodmap -e "${KEYCODE} 85 = Right" # KP_6
xmodmap -e "${KEYCODE} 84 = Down" # KP_5
xmodmap -e "${KEYCODE} 88 = Down" # KP_2
@psygo
psygo / abstract_class_with_constructor.dart
Last active May 25, 2020 17:32
Abstract Classes with Constructors: Why?
void main() {
final B b1 = B();
final C c1 = C();
}
abstract class A {
A(){
print('hello from A');
}
}
@psygo
psygo / settings.json
Last active June 2, 2020 17:45
Example of Customizing Syntax for a Theme in VS Code
{
"editor.tokenColorCustomizations": {
"[One Dark Pro]": {
"types": "#7BC374"
}
}
}