Skip to content

Instantly share code, notes, and snippets.

View doug-orchard's full-sized avatar
🏳️

Doug Orchard doug-orchard

🏳️
View GitHub Profile
@doug-orchard
doug-orchard / gist:247c7234b74ab428a01986b7303ff3dd
Created September 26, 2019 13:19
Firebase functions - create new user in db when new user is added to auth. and send mail
'use strict';
const admin = require('firebase-admin');
const functions = require("firebase-functions");
const nodemailer = require('nodemailer');
admin.initializeApp();
const db = admin.firestore();
@doug-orchard
doug-orchard / create-usb.sh
Last active May 23, 2020 11:59 — forked from bmatcuk/create-usb.sh
Creating a Bootable Windows USB from ISO on a Mac
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list
# This will output a bunch of info about all of the disk drives connected to
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is
# some number starting at 0. Now, insert your USB drive and run the command
# again. You should see a new entry. Make note of the name (ie, /dev/diskX).
diskutil list
@doug-orchard
doug-orchard / extensions.dart
Created February 12, 2020 20:41 — forked from lukepighetti/extensions.dart
Quick example of what an extensions file might look like in one of my projects
import 'package:email_validator/email_validator.dart';
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';
import 'package:flutter/material.dart';
import 'package:flutter/material.dart' as material;
import 'package:intl/intl.dart';
import 'package:rxdart/rxdart.dart';
extension BuildContextExtensions on BuildContext {
dynamic get arguments => ModalRoute.of(this).settings.arguments;
@doug-orchard
doug-orchard / gist:b41d75cf67ff446c8fb9fbde9d1f7316
Created April 30, 2020 12:26
Boxes that are in the center boxes [ copy and past code into dartPad ]
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
Container(
height: 144,
width: 144,
decoration: BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
);
import 'dart:ui';
import 'package:flutter/material.dart';
class FrostedContainer extends StatelessWidget {
final Color color;
final double blur;
final Widget child;
final double width;
final double height;
final double radius;
import 'package:flutter/material.dart';
import 'package:ursakta_mig/views/ticketsView.dart';
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
final double avatarSize = 24;
@override
Widget build(BuildContext _) {
return AppBar(
elevation: 0,
Future.delayed(Duration(milliseconds: 2000)).then((a) => print(a));
import 'dart:async';
int handleData(int data) {
return data * 2;
}
void main() {
final controller = StreamController<int>();
controller.stream