Skip to content

Instantly share code, notes, and snippets.

View MarcinusX's full-sized avatar
🇵🇱
 🇵🇱

Marcin Szałek MarcinusX

🇵🇱
 🇵🇱
View GitHub Profile
@MarcinusX
MarcinusX / main.dart
Created November 21, 2017 18:34
Test for FirebaseUser update
import 'dart:async';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {
@MarcinusX
MarcinusX / Scala test presentation
Last active March 13, 2018 08:12
Tests from college scala test presentation
//
// Presentation: https://goo.gl/GhYvKy
// Dependency: libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % "test"
//
import org.scalatest.{FunSpec, FunSuite}
object Calculator {
@MarcinusX
MarcinusX / Sliver AppBar
Created March 30, 2018 12:17
Sliver AppBar case study created for post on www.marcinszalek.pl
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Sliver Fab Example',
theme: new ThemeData(
@MarcinusX
MarcinusX / infinite_listview.dart
Created April 16, 2018 19:47
This is source code for a blog post.
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@MarcinusX
MarcinusX / officeCustomProperties.md
Created July 13, 2018 12:56
Explanation on sharing custom properties between Office 2013 and Office Online

Office VSTO + jsAPI custom properties manual

Explanation

So far in VSTO we were saving properties separately in every Worksheet. JavaScript API for Office doesn't have such function (as of 13/07/2018). Instead we can save those properties in Workbook's documentProperties which are accessable both in VSTO and JS.

Note: CP means CustomProperties (too long to write every time)

JS (actually TS):

Loading

There is a bug with loading CP, so in order to load them we have to ensure that the list is not empty:

public async setValidation(source: Excel.Range, target: Excel.Range) {
Excel.run(function (context) {
return context.sync().then(() => {
target.dataValidation.rule = {
list: {
inCellDropDown: true,
source: source.values.toString(),
}
};
return context.sync();
@MarcinusX
MarcinusX / card_title.dart
Last active September 4, 2018 07:06
BMI Calculator - Weight
import 'package:flutter/material.dart';
const TextStyle _titleStyle = TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w500,
color: Color.fromRGBO(14, 24, 35, 1.0),
);
const TextStyle _subtitleStyle = TextStyle(
fontSize: 8.0,
https://marcinszalek.pl/tag/bmi-calculator/
@MarcinusX
MarcinusX / main.dart
Created March 21, 2019 19:36
Ripple effect transition
import 'package:flutter/material.dart';
import 'package:rect_getter/rect_getter.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Fab overlay transition',
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/material.dart';
class AirHockey extends StatefulWidget {
@override
_AirHockeyState createState() => _AirHockeyState();
}