Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am andresaraujo on github.
  • I am amarokaz (https://keybase.io/amarokaz) on keybase.
  • I have a public key ASBaRyrCBON6-CO1F8SKRJWU3omYtnzC4lnbUoE8qezXtwo

To claim this, I am signing this object:

@andresaraujo
andresaraujo / animals.dart
Last active April 29, 2017 20:25
JS DCR/Tree shaking VS Dart2JS
main() {
var dog = new Dog('Mitzie');
dog.speak();
}
class Animal {
var name;
Animal(this.name);
speak() => print('$name makes a noise.');
@andresaraujo
andresaraujo / mathedit.md
Last active December 31, 2015 03:37
Math Snippet created with mathedit

Math example

When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are

$$ x = {-b \pm \sqrt{b^2-4ac} \over 2x}. $$

@andresaraujo
andresaraujo / gist:08f5fc87d87cafe7c397
Last active August 29, 2015 14:24
mdl.dart README improvement

Material Design Lite for Dart

A library of Material Design components in CSS, Dart, and HTML ([MDL Dart website][mdldemo]).

Material Design Lite lets you add a Material Design look and feel to your static content websites. It doesn’t rely on any JavaScript frameworks or libraries. Optimised for cross-device use, gracefully degrades in older browsers, and offers an experience that is accessible from the get-go.

Quick Start

@andresaraujo
andresaraujo / app.js
Last active August 29, 2015 14:24
Angular 1 with component directives
angular
.module('myApp', [])
.constant('profileId', 1)
.service('profileService', ProfileService)
.directive('profile', ProfileComponent);
function ProfileService() {
this.mockData = {
1 : {'name': 'Daenerys Targaryen', 'quote': 'I am Daenerys Stormborn and I will take what is mine with fire and blood.'},
2 : {'name': 'Jon Snow', 'quote': 'Don’t call me Lord Snow.'},
@andresaraujo
andresaraujo / app.js
Last active August 29, 2015 14:24
Angular 1 without component directives
angular
.module('myApp', [])
.constant('profileId', 1)
.service('profileService', ProfileService)
.controller('profileController', ProfileController);
function ProfileService() {
this.mockData = {
1 : {'name': 'Daenerys Targaryen', 'quote': 'I am Daenerys Stormborn and I will take what is mine with fire and blood.'},
2 : {'name': 'Jon Snow', 'quote': 'Don’t call me Lord Snow.'},
@andresaraujo
andresaraujo / gist:9ab2af9ef21b5e79e626
Created May 25, 2015 02:15
sprite animation api mock
import 'dart:math' as math;
void main() {
var sc = new AnimationCmp();
sc.add('idle', [1,2,3,4], 8);
sc.add('walk', [5,6,7,8], 12, loop: false);
sc.play('walk');
//To live test it copy&paste code at https://dartpad.dartlang.org/
main() async {
await for (String r in generate9PiDigits()) {
if(r.split('').map((c) => int.parse(c)).fold(0, (p, e) => p + e) == 13) {
print('We find it captain! ${r}');
break;
}
}
}
@andresaraujo
andresaraujo / gist:eb98f8c700bb36c57a23
Created April 23, 2015 18:21
Stacktrace dart2js angular2
Uncaught Uncaught Error: Invalid argument(s): "if" is not a valid (qualified) symbol name
Stack Trace:
Invalid argument(s): "if" is not a valid (qualified) symbol name
at dart.wrapException (http://localhost:8080/main.dart.js:3963:15)
at dart.Symbol.static.Symbol_validatePublicSymbol (http://localhost:8080/main.dart.js:23890:17)
at ReflectionCapabilities.dart.ReflectionCapabilities.setter$1 (http://localhost:8080/main.dart.js:88474:73)
at Reflector.dart.Reflector.setter$1 (http://localhost:8080/main.dart.js:17865:44)
at dart.setterFactory (http://localhost:8080/main.dart.js:20891:71)
at ElementBinderBuilder.dart.ElementBinderBuilder.bindProperty$2 (http://localhost:8080/main.dart.js:21228:53)
at ViewSplitter.dart.ViewSplitter._parseTemplateBindings$2 (http://localhost:8080/main.dart.js:19284:44)
@andresaraujo
andresaraujo / gist:04f52a5d7404678bc22a
Last active August 29, 2015 14:02
Ashley spock unit test example
package ashley
import spock.lang.Specification
import ashley.core.Entity
import ashley.core.Component
class ComponentA extends Component {}
class ComponentB extends Component {}
class ComponentC extends Component {}