Skip to content

Instantly share code, notes, and snippets.

@rodydavis
rodydavis / jenkins_android_gradle_buildNum
Created February 28, 2018 15:56 — forked from firoze/jenkins_android_gradle_buildNum
[Android Gradle] Auto-Increment version code/name in AndroidManifest/Gradle before Jenkins Build
import java.util.regex.Pattern
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0
buildscript {
repositories {
mavenCentral()
}
@rodydavis
rodydavis / README-Template.md
Created March 2, 2018 13:53 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@rodydavis
rodydavis / CustomTabBar.dart
Created March 12, 2019 11:29 — forked from trey-rosius/CustomTabBar.dart
Customized Tab Bar for Login,Sign Up and Forgot Password
import 'package:flutter/material.dart';
void main() {
runApp(HomePage());
}
class HomePage extends StatefulWidget {
@override
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
void main() => runApp(ExampleApp());
class ExampleApp extends StatelessWidget {
@override
@rodydavis
rodydavis / macapp.go
Created March 28, 2019 19:31 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@rodydavis
rodydavis / README.md
Last active April 10, 2019 16:21 — forked from kasperpeulen/README.md
How to pretty-print JSON using Dart.
@rodydavis
rodydavis / run_logged.dart
Last active April 18, 2019 11:56 — forked from slightfoot/run_logged.dart
Logging your app's print statements to a local file for later processing.
import 'dart:async';
import 'dart:core';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
void main() => runLoggedApp(App());
@rodydavis
rodydavis / guide.txt
Created April 23, 2019 17:49 — forked from tomaszpolanski/guide.txt
Building Flutter for MacOS
- `flutter channel master && flutter doctor`
- `export ENABLE_FLUTTER_DESKTOP=true`
- `git clone git@github.com:google/flutter-desktop-embedding.git`
- Move your project inside the `flutter-desktop-embedding` folder
- Copy the `macos` folder from `flutter-desktop-embedding/example` to your project
- `cd flutter-desktop-embedding/my-project && flutter run -d macos`
@rodydavis
rodydavis / programmatic-dynamic-images.m
Created June 8, 2019 23:32 — forked from timonus/programmatic-dynamic-images.m
Programmatically create iOS 13 dynamic images
- (UIImage *)dynamicImage
{
UITraitCollection *const baseTraitCollection = /* an existing trait collection */;
UITraitCollection *const lightTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleLight]]];
UITraitCollection *const purelyDarkTraitCollection = [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleDark];
UITraitCollection *const darkTraitCollection = UITraitCollection *lightTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, purelyDarkTraitCollection]];
__block UIImage *lightImage;
[lightTraitCollection performAsCurrentTraitCollection:^{
lightImage = /* draw image */;
@rodydavis
rodydavis / scratch_card.dart
Created June 13, 2019 22:06 — forked from slightfoot/scratch_card.dart
Scratch Card - Unfinished Flutter implementation of https://allu.io/react-scratchcard/
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'dart:math' as math;
void main() => runApp(DemoApp());
class DemoApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(