This file contains hidden or 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
var http = require('restler'), | |
jsdom = require('jsdom'); | |
function getPrice(html) { | |
var start = html.search(/\$\d+/); | |
if (start === -1) { | |
return -1; | |
} | |
return +html.substring(start + 1, html.substring(start + 1).search(/\D+/) + 1); | |
}; |
This file contains hidden or 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
/** NavController */ | |
'use strict'; | |
testnavApp.controller('NavController', function($scope, $location) { | |
$scope.isActiveTab = function(tab) { | |
return $location.path().indexOf(tab) !== -1; | |
}; | |
}); | |
/** html **/ |
This file contains hidden or 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
#example { | |
width: 75px; | |
height: 75px; | |
background-color: black; | |
-moz-transition: all 2s ease-in-out 0.5s; | |
-o-transition: all 2s ease-in-out 0.5s; | |
-webkit-transition: all 2s ease-in-out 0.5s; | |
transition: all 2s ease-in-out 0.5s | |
} |
This file contains hidden or 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
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}; |
This file contains hidden or 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
<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'> |
This file contains hidden or 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
function Isolate() {} | |
init(); | |
var $$ = {}; | |
var $ = Isolate.$isolateProperties; | |
$$.ExceptionImplementation = {"": | |
["_msg"], | |
super: "Object", | |
toString$0: function() { | |
var t1 = this._msg; |
This file contains hidden or 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'); | |
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); |
This file contains hidden or 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
#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'); | |
} |
This file contains hidden or 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
function Isolate() {} | |
init(); | |
var $$ = {}; | |
var $ = Isolate.$isolateProperties; | |
$$.HashMapImplementation = {"": | |
["_numberOfDeleted", "_numberOfEntries", "_loadLimit", "_values", "_keys"], | |
super: "Object", | |
toString$0: function() { | |
return $.Maps_mapToString(this); |
This file contains hidden or 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
int N = 1000000; | |
void main() { | |
List<int> arr = initArray(); | |
Stopwatch start = new Stopwatch(); | |
start.start(); | |
arr = mergeSort(arr); | |
start.stop(); | |
print(start.elapsedInMs()); |