Skip to content

Instantly share code, notes, and snippets.

@chrisbu
chrisbu / ditest.dart
Created January 29, 2014 17:22
Injecting foos and bars with di
import 'package:di/di.dart';
import 'package:di/dynamic_injector.dart';
void main() {
var modules = [new SimpleModule(), new EnterpriseModule()]; // last one wins!
var di = new DynamicInjector(modules:modules);
var foo = di.get(Foo);
var bar = di.get(Bar);
@chrisbu
chrisbu / AsyncTest.dart
Created June 26, 2012 10:39
Async test with dart:html
#import('dart:html');
#import("lib/unittest/unittest.dart");
#import("lib/unittest/html_config.dart");
void main() {
useHtmlConfiguration();
test('aync test', () {
@chrisbu
chrisbu / AsyncTest.html
Created June 26, 2012 10:45
Async test html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AsyncTest</title>
<link rel="stylesheet" href="AsyncTest.css">
</head>
<body>
<h1>AsyncTest</h1>
@chrisbu
chrisbu / gist:4272378
Created December 12, 2012 22:48
Catching stream exception
try {
// try and write to the stream
}
on StreamException {
// handle the exception
}
@chrisbu
chrisbu / coverage.txt
Created July 17, 2013 09:02
Example output from Dart's coverage tool.
Coverage target process (pid 6476) found listening on port 51189.
Debuggee isolate id 7114 created.
Debuggee isolate id 7114 shut down.
Sending kill signal to process 6476.
Connection closed by coverage target
Process 6476 terminated with exit code 0.
Coverage info collected from 42 breakpoints:
file:///c:/Work/dart/projects/test.dart
|library mytest;
|
body {
background-color: #F8F8F8;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
font-weight: normal;
line-height: 1.2em;
margin: 15px;
}
h1, p {
import 'dart:html';
void main() {
var carousel = query(".carousel");
var classList = [];
carousel.children.forEach((childElement) => classList.addAll(childElement.classes));
print(classList);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sample app</title>
<link rel="stylesheet" href="words.css">
<!-- This is the bootstrap script for Polymer.
Use this INSTEAD of dart.js -->
@chrisbu
chrisbu / install SonarQube on Raspberry Pi
Last active October 22, 2021 14:39 — forked from synox/install SonarQube on Raspberry Pi
How to install SonarQube on Raspberry PI
SonarQube does currently not support Raspberry PI.
This is a workaround. It compiles a armv6 compatible version of the java-wrapper and configures sonarqube to use it.
(Testet with Raspbian, wheezy, 3.6)
CHRIS: Also, start here: https://computingforgeeks.com/install-node-js-14-on-ubuntu-debian-linux/ (and carry on below when sonar fails to start)
Compile java-wrapper for ARMv6
============================