Skip to content

Instantly share code, notes, and snippets.

Aaron wiredprairie

Block or report user

Report or block wiredprairie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wiredprairie
wiredprairie / tree.go
Created Nov 18, 2016
Code for small app that outputs a tree to the console of a directory path
View tree.go
package main
/*
The MIT License (MIT)
Copyright (c) 2016 WiredPrairie.us
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
@wiredprairie
wiredprairie / golang_contextWithTimeout.go
Last active Sep 11, 2018
Golang context.WithTimeout Demo
View golang_contextWithTimeout.go
package main
import (
"context"
"fmt"
"time"
)
func main() {
wait := make(chan bool)
@wiredprairie
wiredprairie / example.py
Created Nov 10, 2017
Example LARGE Python file
View example.py
This file has been truncated, but you can view the full file.
"""
This file is an example of a very large file in Python that highlights a performance issue with intellisense in VSCode
and the current Python extension. It takes 20+ seconds to show the list of properties.
DataSource: FriendlyExample
"""
class Column:
def __init__(self, parent, column_name):
View example-flutter-1.dart
return new Container(
margin: const EdgeInsets.symmetric(vertical: 6.0, horizontal: 8.0),
child:
new Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Container(
margin: const EdgeInsets.only(right: 16.0),
child: new ConstrainedBox(
constraints: const BoxConstraints(
View flutter-state-ex-1.dart
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
View flutter-async-ex-1.dart
Future<File> _getCacheFile() async {
var dir = (await getApplicationDocumentsDirectory()).path;
return new File('$dir/hotlist.xml');
}
View _showGameItem.dart
_showGameItem(BuildContext context, BoardGameItem item) {
Navigator.push(context, new MaterialPageRoute(
builder: (BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(item.name)
),
body: new SizedBox.expand(
child: new Hero(tag: item.id,
child: new Container(
View _showGameItem-2.dart
_showGameItem(BuildContext context, BoardGameItem item) {
Navigator.push(context, new MaterialPageRoute(
builder: (BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(item.name)
),
body: new SizedBox.expand(
child: new Hero(tag: item.id,
child: new Container(
View onTap-1-ex.dart
return new GestureDetector(
onTap: () {
_selectGameItem(context, item);
},
child: new Container(
View saving-cache-file.dart
Future<File> _getCacheFile() async {
final dir = (await getApplicationDocumentsDirectory()).path;
return new File('$dir/hotlist.xml');
}
Future<XmlDocument> _getHotListCache() async {
try {
final file = await _getCacheFile();
return parse(await file.readAsString());
}
You can’t perform that action at this time.