Skip to content

Instantly share code, notes, and snippets.

View IchordeDionysos's full-sized avatar

Dennis Kugelmann IchordeDionysos

View GitHub Profile
@IchordeDionysos
IchordeDionysos / 0_reuse_code.js
Created October 12, 2016 18:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am IchordeDionysos on github.
  • I am ichordedionysos (https://keybase.io/ichordedionysos) on keybase.
  • I have a public key whose fingerprint is 1558 6A59 6A20 6F98 E72F 046B A0E3 6744 FB13 DFE5

To claim this, I am signing this object:

@IchordeDionysos
IchordeDionysos / main.dart
Created June 1, 2019 17:16
SizedBox Katex example with WebView
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
void main() => runApp(TestApp());
class TestApp extends StatelessWidget {
TestApp({Key key}) : super(key: key);
// This widget is the root of your application.
@IchordeDionysos
IchordeDionysos / demonstration.sh
Last active July 18, 2019 09:28
Demonstrates the problem when deploying functions of different repos to the same project
echo "Trying this out on Firebase version:"
firebase --version
echo "We are setting up a demonstration project"
mkdir demonstration
cd demonstration/
echo "Please select Javascript and no eslint and to install using npm"
firebase init functions
echo "Creating two sample functions"
@IchordeDionysos
IchordeDionysos / main.dart
Created September 3, 2019 11:34
Flutter navigate in response to a MethodChannel call without Context
void main() => runApp(SimpleclubApp());
// ignore: must_be_immutable
class SimpleclubApp extends StatelessWidget {
static const channel = const MethodChannel('com.simpleclub.flutter.channel');
BuildContext currentContext;
Map<String, dynamic> screenInfo;
MaterialApp app;
static bool get isInDebugMode {
@IchordeDionysos
IchordeDionysos / main.dart
Created September 9, 2019 18:34
RemoteConfig.instance Future already complete
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter/material.dart';
void main() {
@IchordeDionysos
IchordeDionysos / main.dart
Last active December 15, 2019 13:28
Ruby-like delegate methods
class Info {
String address = "12 LTC";
String name = "Tobiwon";
}
// Example with mixins: https://dart.dev/guides/language/language-tour#adding-features-to-a-class-mixins
class Person1 with Info { }
// Example with class extensions: https://dart.dev/guides/language/language-tour#adding-features-to-a-class-mixins
class Person2 extends Info { }
@IchordeDionysos
IchordeDionysos / main.dart
Created December 26, 2019 21:02
Conditional Cast in Dart as Extension method
// The same as `variable as T`, but instead of throwing an error `null` is returned
extension ConditionalCast on Object {
T tryCast<T>() {
final Object self = this;
return self is T ? self : null;
}
}
main() {
final Map<String, dynamic> dict = {