Video tutorial: https://youtu.be/7tpO9vhUhf4
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'; | |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new Scaffold( | |
appBar: new AppBar( | |
title: const Text('My App'), | |
), | |
body: new Center( |
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:html'; | |
final ButtonElement $button = querySelector('#button'); | |
final Iterable<AnchorElement> $links = querySelectorAll('a:not(.active)'); | |
void main() { | |
$button.onClick.listen((_) { | |
window.alert('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 'package:angular/angular.dart'; | |
@Component(selector: 'foo-cmp', templateUrl: 'foo_cmp.html') | |
class FooComponent { | |
String name = 'Bob'; | |
List<String> colors = ['red', 'blue', 'green', 'fuchsia']; | |
} |
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:angel_framework/angel_framework.dart'; | |
import 'package:mongo_dart/mongo_dart.dart'; | |
/// Chooses the database associated with the [tenantId], and injects it into the [RequestContext]. | |
/// | |
/// @[Header] annotation is used to parse out the `x-tenant` header, if it is not present, a 400 is thrown. | |
Future<bool> chooseDatabase(@Header('x-tenant') tenantId, Db db, RequestContext req) async { | |
// Assuming that you have a collection that maps tenant ID's to collection names: | |
var mapping = await db.collection('tenants').findOne(where.id(new ObjectId.fromHexString(tenantId))); |
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
## Concept | |
It sucks to do the following: | |
* Write an AST | |
* Write a scanner | |
* Write a parser | |
* Test the parser | |
* Write language documentation | |
So... Why not do it automatically? |
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
Press CTRL+SHIFT+Y (PC) or COMMAND+SHIFT+Y (Mac) to auto-click all the follow or unfollow buttons on Crowdfire, | |
with a small delay (200ms) in-between. | |
Sends a notification when the process completes. Saves a lot of time, and makes it much easier to grow your following | |
without all the clicking. |
An ASM-inspired language that uses some familiar constructs to make building ASM easier.
It's basically ASM, but labels are given a function syntax. There also exists the concept of pointers, which are converted into address literals.
Declaring external functions is also supported, which makes it possible to verify the syntax of calls at compile time.
All in all, the compiler will be written in C++, and should in theory be quite fast, because in reality it is just a simple transpiler.
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:dig/delegate.dart'; | |
import 'package:path/path.dart' as p; | |
main(_, SendPort sendPort) { | |
return Dig.run(sendPort, (Dig dig) async { | |
var dig = await Dig.create(sendPort); | |
// Wait for these tasks to finish, or run them if they have not been completed. | |
await dig.depend(['string_scanner', 'source_span:some_task']); |
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
models { | |
// Define models (functions) | |
line(x: Num) -> Num | |
// Struct? | |
nlp(text: String, len: Num) -> (category: String, confidence: Num) | |
opts { cache } | |
} | |
train { |