Skip to content

Instantly share code, notes, and snippets.

@ProjectInitiative
ProjectInitiative / pull-all.sh
Last active May 23, 2019 04:31
Pull all immediate Git repo children in the current directory
#!/usr/bin/env bash
for D in `find . -maxdepth 1 -mindepth 1 -type d`
do
echo $D
cd $D
git pull
cd ..
done

Keybase proof

I hereby claim:

  • I am projectinitiative on github.
  • I am kylepetryszak (https://keybase.io/kylepetryszak) on keybase.
  • I have a public key ASCkjdmSHqiIEnGB9101TqFuZEamxp1Ebhq8NB0XlprOuwo

To claim this, I am signing this object:

@ProjectInitiative
ProjectInitiative / FutureStreamBuilder.dart
Last active March 25, 2019 19:27
A quick example on how to implement a StreamBuilder that requires a Future<String> within the stream: attribute
FutureBuilder(
future: _getUID(),
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
if (snapshot.connectionState != ConnectionState.done)
return new Center(
child: new Container(child: CircularProgressIndicator()));
return new StreamBuilder(
stream: _getStream(snapshot.data.toString()),
builder: (BuildContext context, userSnapshot) {
// TEMPORARY FIX
@ProjectInitiative
ProjectInitiative / Stopwatch.cs
Created January 29, 2019 19:42
Used to format nanoseconds into HH:MM:SS.ms formatting as well as managing the actual elapsed time in between pauses relative to the system clock time regardless of how many times the user decides to pause and resume. Current functions did not return enough detail to achieve the required accuracy. Provided files are in Java and C#
using System;
/*
Created by Kyle on 3/8/2015.
Note: This class is simply a calculation/String formatting class designed to calculate the elapsed time between two clock readings.
To fully integrate this into a practical use please use a thread to call either getElapsedTime or getElapsedMilliTime and display that text to the screen.
*/
namespace CommonLibrary.Helpers
{
public class Stopwatch
@ProjectInitiative
ProjectInitiative / FlutterLicense.dart
Created January 29, 2019 19:39
A quick example of how to implement a licence page and license dialog in Flutter.
// FlutterLicense utility class
import 'package:flutter/foundation.dart';
class FlutterLicense extends LicenseEntry {
final packages;
final paragraphs;
FlutterLicenses(this.packages, this.paragraphs);
}