Skip to content

Instantly share code, notes, and snippets.

Working From Home

Rody Davis rodydavis

Working From Home
View GitHub Profile
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
View flutter_animations.dart
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
rodydavis /
Created Jun 6, 2022
flutter script to build app on Xcode Cloud ci_scripts/
# Install CocoaPods using Homebrew.
brew install cocoapods
# Install Flutter
brew install --cask flutter
# Run Flutter doctor
flutter doctor
rodydavis / flutter_master_detail.dart
Last active Apr 9, 2022
Flutter Master Detail View
View flutter_master_detail.dart
import 'package:flutter/material.dart';
class MasterDetail<T> extends StatefulWidget {
const MasterDetail({
Key? key,
required this.listBuilder,
required this.detailBuilder,
required this.onPush,
}) : super(key: key);
View theme-adapter.css
:root {
--mdc-theme-primary: var(--md-sys-color-primary);
--mdc-theme-on-primary: var(--md-sys--coloron-primary);
--mdc-theme-background: var(--md-sys--colorbackground);
--mdc-theme-on-background: var(--md-sys--coloron-background);
--mdc-theme-on-surface-variant: var(--md-sys--coloron-surface-variant);
--mdc-theme-surface-variant: var(--md-sys--colorsurface-variant);
--mdc-theme-on-surface: var(--md-sys--coloron-surface);
--mdc-theme-surface: var(--md-sys--colorsurface);
--mdc-theme-text-primary-on-background: var(--md-sys--coloron-surface-variant);
rodydavis / material_outlined_card.dart
Created Mar 9, 2022
Flutter Material Outlined Card
View material_outlined_card.dart
import 'package:flutter/material.dart';
class OutlinedCard extends StatefulWidget {
const OutlinedCard({
Key? key,
required this.child,
}) : super(key: key);
final Widget child;
rodydavis / controller.ts
Last active Mar 1, 2022
HTML Canvas Controls with painting, zoom at cursor, clicking and keyboard shortcuts
View controller.ts
import { drawInfiniteGrid } from "./infinite-grid";
import {
} from "./transformer";
import { color } from "./utils";
export class CanvasController<
T extends CanvasWidget
rodydavis / color-input.ts
Last active Feb 24, 2022
Color input with lit
View color-input.ts
import { html, css, LitElement } from "lit";
import { customElement, property } from "lit/decorators.js";
/** Color Input */
export class ColorInput extends LitElement {
static override styles = css`
main {
--input-size: 48px;
--padding: 4px;
rodydavis / action.dart
Created Feb 17, 2022
Action manager example for flutter
View action.dart
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../model.dart';
abstract class AppAction extends Intent {
LogicalKeySet? get keys => null;
void action(AppModel model);
String get label;
rodydavis / app.js
Created Feb 10, 2022
Material You on the Web
View app.js
import * as utils from "";
function themeFromSeed(seed) {
const palette = utils.CorePalette.of(seed);
return {
seed: seed,
schemes: {
light: utils.Scheme.light(seed),
dark: utils.Scheme.dark(seed),