Skip to content

Instantly share code, notes, and snippets.

View kevinwestern's full-sized avatar

Kevin Western kevinwestern

View GitHub Profile
var test = [1,2,3],
copy = test.slice();
int N = 1000000;
void main() {
List<int> arr = initArray();
Stopwatch start = new Stopwatch();
start.start();
merge_sort(arr, 0, N);
start.stop();
print(start.elapsedInMs());
int N = 1000000;
void main() {
List<int> arr = initArray();
Stopwatch start = new Stopwatch();
start.start();
arr = mergeSort(arr);
start.stop();
print(start.elapsedInMs());
function Isolate() {}
init();
var $$ = {};
var $ = Isolate.$isolateProperties;
$$.HashMapImplementation = {"":
["_numberOfDeleted", "_numberOfEntries", "_loadLimit", "_values", "_keys"],
super: "Object",
toString$0: function() {
return $.Maps_mapToString(this);
#source('Model.dart');
void main() {
Map<String, Dynamic> m = new Map();
m['name'] = 'Kevin';
Model simpleModel = new Model(m);
simpleModel.set('name', 'kevin').set('age', 24).save().save();
print('done');
}
#import('dart:html');
List<Element> remaining;
int gameInterval = null, position = 0, points = 0;
Element selectedEl = null, pointsTally = null;
void main() {
remaining = new List<Element>();
TableElement table = createTable(3, 4);
function Isolate() {}
init();
var $$ = {};
var $ = Isolate.$isolateProperties;
$$.ExceptionImplementation = {"":
["_msg"],
super: "Object",
toString$0: function() {
var t1 = this._msg;
<div>
<h2>Weight Chart</h2>
<input type='number' class="input-medium search-query" ng-model='myweight' placeholder='Enter a weight..'/>
<table class='table table-bordered table-striped'>
<thead>
<tr>
<td>
lbs.
</td>
<td ng-repeat='percent in percentages'>
var Person = function (name, age) {
this.name = name;
this.age = age;
}
new Person('bob', 22); => {name: 'bob', age: 22}
// or this
var bob = {name: 'bob', age: 22};