This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fetch JSON from the API. | |
*/ | |
function fetchLatestJson() { | |
var token = UserProperties.getProperty("fioApiToken"); | |
if (token === null) { | |
throw "Fio API Token not set. Please go to File > Project properties > User properties and create token fioApiToken."; | |
} | |
var response = UrlFetchApp.fetch("https://www.fio.cz/ib_api/rest/last/"+token+"/transactions.json"); | |
if (response.getResponseCode() !== 200) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Takes [count] of items and the [partition] (array of percentages) to | |
// distribute against. Returns an array of integers that sums to [count]: | |
// an integer composition weighted by the partition. | |
// | |
// We don't use the Bresenham algorithm because it doesn't provide the best | |
// results for low values of [count]. | |
function DISTRIBUTE(count, partition) { | |
// Custom function in Apps Script takes a 2D array. We're only interested in | |
// the first row. | |
partition = partition[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="application/dart" src="main.dart"></script> | |
<script src="packages/browser/dart.js"></script> | |
</head> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main() => print("Hello World!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'dart:math'; | |
import 'package:html/dom.dart'; | |
import 'package:html/parser.dart'; | |
import 'package:markdown/markdown.dart' as md; | |
main(args) { | |
var mdSource = new File(args.single).readAsStringSync(); | |
var html = md.markdownToHtml(mdSource); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DEFAULT_HASH=76468dd | |
if [ -z "$1" ] | |
then | |
echo "You can provide the commit hash you're interested in as argument." | |
echo "Defaulting to $DEFAULT_HASH." | |
HASH=$DEFAULT_HASH | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o vi | |
# Change this accordingly. | |
# You may have github.com/flutter/flutter named as "upstream". | |
REMOTE_NAME=origin | |
# The hash we search for when no argument is given. | |
DEFAULT_HASH=76468dd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:sliver_fbs/src/names.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:scoped_model/scoped_model.dart'; | |
void main() { | |
// The app state. | |
final myModel = CounterModel(42); | |
// A timer, to simulate updates coming from outside the app. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:scoped_model/scoped_model.dart'; | |
void main() { | |
// Initialize the model. Can be done outside a widget, like here. | |
var counter = Counter(); | |
// Just because we can: wait five seconds after the start of the app ... |
OlderNewer