Skip to content

Instantly share code, notes, and snippets.

View ThinkDigitalSoftware's full-sized avatar
💭
An app a day keeps the doctor away

Jonathan White ThinkDigitalSoftware

💭
An app a day keeps the doctor away
  • ThinkDigitalSoftware
  • California, United States of America
View GitHub Profile
@ThinkDigitalSoftware
ThinkDigitalSoftware / main.dart
Last active December 29, 2022 22:41
Flutter Increment Counter Example
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
@ThinkDigitalSoftware
ThinkDigitalSoftware / main.dart
Created November 15, 2018 08:07
number_obfuscation
main(){
String number = "3231234545";
String xedNumber="";
for(int i = 0; i < number.length; i++){
if(i > 2 && i< number.length - 2)
xedNumber += "x";
else
xedNumber += number[i];
}
print(xedNumber);
import java.nio.file.Path
import java.nio.file.Paths
import com.android.builder.model.AndroidProject
import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.Plugin
import org.gradle.api.Task
@ThinkDigitalSoftware
ThinkDigitalSoftware / flutter_update
Last active November 3, 2018 16:04
flutter_fast_forward _and_update
#! /bin/sh
if [ -z "$1" ]
then
echo "Please enter a channel name after \"flutter_update\""
else
cd ~/development/flutter/
git pull
flutter channel $1
fi
@ThinkDigitalSoftware
ThinkDigitalSoftware / main.dart
Last active September 27, 2018 18:25
Null-aware Operators in Dart Examples
main() {
// ?? operator
print("\n?? operator \n");
var x; // x is null
String otherExp = "x is null";
print(x ?? otherExp); // returns otherExp, which is a String, to print.
var isXNull = x ?? true;
print(isXNull);
//is the same as
@ThinkDigitalSoftware
ThinkDigitalSoftware / main.dart
Created August 11, 2018 16:01
enumString Example
void main() {
var one = enumString.HELLO;
print(one);
if(one == enumString.HELLO)
print("$one, Jonathan!");
}
class enumString{
static const HELLO="hello";
}
@ThinkDigitalSoftware
ThinkDigitalSoftware / main.dart
Last active August 2, 2018 00:34
StreamExample
import 'dart:async';
void main() {
int count = 0;
var counterController = new StreamController();
counterController.stream.listen((value) => print(value));
void increment() {
counterController.add(count++);
}
#THIS NEEDS SUPER USER ACCESS. Verify that you want to do this first, since rm -rf asks no questions!
#Copy and past this in your terminal when you are ready. I hold no liability for your choice.
sudo rm -rf "/Applications/GarageBand.app"
sudo rm -rf "/Library/Application Support/GarageBand"
sudo rm -rf "/Library/Application Support/Logic"
sudo rm -rf "/Library/Audio/Apple Loops"
@ThinkDigitalSoftware
ThinkDigitalSoftware / NSAppTransportSecurity
Created July 21, 2018 03:59
Allow insecure connections through HTTP. This goes in your Info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>livekingdomhall.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
main(List<String> arguments) {
runApp(new MaterialApp(
title: "Test",
home: CongregationImage(
isLoading: true,
screenHeight: 100.0,
orientation: Orientation.portrait,