Skip to content

Instantly share code, notes, and snippets.

@derekedelaney
derekedelaney / flutter_tabs.dart
Last active Sep 2, 2021
Flutter tabs overflow accessibility issue
View flutter_tabs.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
View master_detail_example.dart
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
@derekedelaney
derekedelaney / selected_list_bug.dart
Created Jun 25, 2021
Showing a selected list bug when using IndexedStack
View selected_list_bug.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(),
@derekedelaney
derekedelaney / main.dart
Last active Jun 4, 2021
Sign in form with forgot password on bottom
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(App());
}
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@derekedelaney
derekedelaney / show_confetti_dialog.dart
Created May 12, 2021
Adds confetti to a flutter Dialog
View show_confetti_dialog.dart
import 'package:flutter/material.dart';
import 'package:confetti/confetti.dart';
Future<T> showConfettiDialog<T>({
@required BuildContext context,
WidgetBuilder builder,
bool barrierDismissible = true,
Color barrierColor,
bool useSafeArea = true,
bool useRootNavigator = true,
@derekedelaney
derekedelaney / WindowSize.tsx
Last active May 8, 2020
Add the window size as a prop to your React component. For class and function components with hooks.
View WindowSize.tsx
import React, { useEffect, useState } from 'react';
export enum WINDOW_SIZE {
XSMALL = 375,
SMALL = 768,
MEDIUM = 1024,
LARGE = 1200,
XLARGE = 1440,
}
@derekedelaney
derekedelaney / .drive_global_blacklist.filter
Created Dec 2, 2019
A blacklist for Synology folders and files.
View .drive_global_blacklist.filter
[Version]
major = 1
minor = 1
[Common]
@derekedelaney
derekedelaney / regexCheatsheet.js
Created Jan 15, 2019 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
View regexCheatsheet.js
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@derekedelaney
derekedelaney / helper-util.js
Created Jul 23, 2018
simple javascript helper functions
View helper-util.js
// Intersection
let intersection = arr1.filter(x => arr2.includes(x));
// Difference
let difference = arr1.filter(x => !arr2.includes(x));
// Symmetric Difference
let difference = arr1
.filter(x => !arr2.includes(x))
.concat(arr2.filter(x => !arr1.includes(x)));
View karabiner.json
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {