Skip to content

Instantly share code, notes, and snippets.

View jaumard's full-sized avatar

Jimmy Aumard jaumard

View GitHub Profile
@jaumard
jaumard / main.dart
Created March 22, 2021 16:53
Simple layout
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@jaumard
jaumard / main.dart
Last active November 23, 2020 12:46
FocusScope bug
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. 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:flutter/material.dart';
void main() => runApp(MyApp());
@jaumard
jaumard / main.dart
Created July 8, 2020 11:34
Basic rotation animation with Hooks
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
@jaumard
jaumard / main.dart
Last active July 8, 2020 10:05
Basic rotation animation with StatefulWidget
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
@jaumard
jaumard / main.dart
Last active March 24, 2021 21:05
Simple Autocomplete Flutter
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:rxdart/rxdart.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@jaumard
jaumard / main.dart
Created July 1, 2019 14:08
immutable jaguar models
import 'dart:io';
import 'package:jaguar_query_postgres/jaguar_query_postgres.dart';
import 'models.dart';
/// The adapter
final adapter = PgAdapter('postgres', username: 'postgres', password: 'postgres');
main() async {
@jaumard
jaumard / main.dart
Created June 3, 2019 10:32
staggered grid
import 'dart:math' as math;
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class _CoordinateOffset {
final double main, cross;
_CoordinateOffset(this.main, this.cross);
}
@jaumard
jaumard / main.kt
Created April 19, 2018 09:05
Problem with kotlin generics
data class CustomerPersonalInfo(val memberNumber: String,
val name: String,
val surname: String,
val taxId: Int) {
private constructor(builder: Builder) : this(builder.memberNumber,
builder.name,
builder.surname,
builder.taxId)
@jaumard
jaumard / proxy.js
Last active January 5, 2016 15:06
/**
* Node.js proxy to redirect domain to correct server
* Also check is server is alive or send a maintenance page
*/
var http = require('http'),
httpProxy = require('http-proxy'),
proxy = httpProxy.createProxyServer({}),
request = require('request'),
domains = {
"domain1.com" : "localhost:8080",