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> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<style> | |
#px { | |
width: 37.8px; | |
height: 37.8px; | |
background: red; | |
} | |
#cm { |
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
Future<Response> helloPost(HttpRequest request) { | |
return request.toList().then((List<List<int>> buffer) { | |
var name = new String.fromCharCodes(buffer.expand((i) => i).toList()); | |
name = name.isNotEmpty ? name : 'World'; | |
return new Response("Hello, $name!"); | |
}); | |
} |
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
Name: dart | |
Cartridge-Short-Name: DART | |
Display-Name: Dart Cartridge | |
Description: A dart cartridge | |
Version: 0.6.3 | |
License: MIT | |
Vendor: google | |
Cartridge-Version: 0.0.1 | |
Cartridge-Vendor: filirom1 | |
Categories: |
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
register(Request request) { | |
var user = new User.fromJson(request.json); | |
if (!user.emailIsValid || !user.hashIsValid) { | |
return new Response('invalid data', status: Status.ERROR); | |
} | |
return db.open().then((_) { | |
DbCollection users = db.collection('Users'); |
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
part of cogito; | |
class User { | |
/// Email validation according to WHATWGs HTML5 type="email" standard. | |
final EMAIL_REGEX = new RegExp(r'''^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$'''); | |
String email = ''; | |
String password = ''; | |
String hash = ''; |
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
/** | |
* Shortcut method for GET requests. See [Http.call] for a complete description | |
* of parameters. | |
*/ | |
Future<HttpResponse> get(String url, {String data, Map<String, dynamic> params, | |
Map<String, String> headers, xsrfHeaderName, | |
xsrfCookieName, interceptors, cache, timeout} | |
) => _http.get(url, data: data, params: params, | |
headers: headers, xsrfHeaderName: xsrfHeaderName, | |
xsrfCookieName: xsrfCookieName, interceptors: interceptors, |
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
new RestServer() | |
..clientRoutes = ['/page'] | |
..static(STATIC_PATH, jailRoot: false) | |
..route(new Route('/api/auth') | |
..post = authorization.register | |
..put = authorization.login) | |
..preprocessor(authorization.checkLogin) | |
..route(new Route('/api/checkAuth') | |
..get = authorization.success) | |
..route(new Route('/api/page/{id}') |
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:mirrors'; | |
import 'package:guinness/guinness.dart'; | |
class Test { | |
Iterable iterable; | |
Iterable<int> typedIterable; | |
} | |
main() { | |
describe('Dart', () { |
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
Match (Movie, {'name': 'Avatar'}) -[#r]>> n(#actor, Actor). | |
Where ([#r, {'role': Do.exist}]). | |
Optional (Match (#actor) -['actedIn']- n(#movie, Movie)). | |
Return ([#actor, #movie]); | |
Match (Movie, {'name': 'Avatar'}) <<_([#r, 'rated'])- n(User). | |
Where ([#r, {'rating': Is.greaterThan(4.5)}]). | |
Return ([#r]); |
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
[layout] { | |
display: flex; | |
} | |
[layout="row"] { | |
flex-direction: row; | |
} | |
[layout="column"] { | |
flex-direction: column; |
OlderNewer