Skip to content

Instantly share code, notes, and snippets.

Working From Home

Rody Davis rodydavis

Working From Home
View GitHub Profile
rodydavis / ltxml.js
Created April 5, 2023 17:26 — forked from xndcn/ltxml.js
View ltxml.js
Copyright (c) Microsoft Corporation 2013.
This code is licensed using the Microsoft Public License (Ms-PL). You can find the text of the license here:
Published at
Resource Center and Documentation:
View flutter_adaptive_markdown_source.dart
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return const MaterialApp(
rodydavis / riverpod_flutter_widgets.dart
Created March 12, 2023 02:55
Using Riverpod for Widget generation
View riverpod_flutter_widgets.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'generated.g.dart';
class GeneratedWidget extends _$GeneratedWidget {
rodydavis / run.dart
Last active February 2, 2023 15:51
Cross platform Flutter compute method
View run.dart
export '' if (dart.library.html) 'run.web.dart';
rodydavis / dart_to_dart.dart
Created January 10, 2023 02:41
Dart ast to dart export
View dart_to_dart.dart
// 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:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:meta/meta.dart';
/// A visitor used to write a source representation of a visited AST node (and
rodydavis / flutter_infinite_canvas.dart
Last active January 13, 2023 23:52
Flutter infinite canvas with InteractiveViewer + CustomMultiChildLayout
View flutter_infinite_canvas.dart
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math_64.dart' hide Colors;
void main() {
final controller = WidgetCanvasController([
key: UniqueKey(),
size: const Size(400, 800),
child: Scaffold(
rodydavis / flutter_canvas_demo.dart
Last active December 23, 2022 23:18
Flutter Canvas Demo
View flutter_canvas_demo.dart
import 'package:flutter/material.dart';
void main() {
runApp(const StoryBoardExample());
class StoryBoardExample extends StatelessWidget {
const StoryBoardExample({super.key});
rodydavis / flutter_material_3_markdown_view.dart
Created September 13, 2022 15:43
Material 3 Theme for Markdown package in Flutter
View flutter_material_3_markdown_view.dart
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:go_router/go_router.dart';
import 'package:markdown/markdown.dart' as md;
import 'package:url_launcher/url_launcher.dart';
class MarkdownView extends StatelessWidget {
const MarkdownView({
Key? key,
required this.markdown,
View index.html
<!DOCTYPE html>
<title>Hello World</title>
<link rel="stylesheet" href="">
<link rel="stylesheet" href="style.css">
<body class="light-theme">
<button class="button filled">Button</button>
<script src="main.ts"></script>
rodydavis / gist:8a819c292b39826382f242415dc19b21
Created July 24, 2022 03:58 — forked from jampajeen/gist:d19f36a7309d0ead0e1f9735a26d66f3
Disable/Enable Mac OSX sleep on lid closed
View gist:8a819c292b39826382f242415dc19b21
# disable sleep
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1
# re-enable sleep
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0