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
/** | |
* Created with JetBrains WebStorm. | |
* User: mario.ruiz | |
* Date: 05/09/13 | |
* Time: 15:31 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
window.addEvent('domready', function() { | |
jQuery.noConflict(); |
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> | |
<title>Test Suite</title> | |
<script> | |
function assert( value, desc ) { | |
var li = document.createElement("li"); | |
li.className = value ? "pass" : "fail"; | |
li.appendChild( document.createTextNode( desc ) ); | |
document.getElementById("results").appendChild( li ); | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<classpath> | |
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> | |
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> | |
<classpathentry kind="src" path="src"/> | |
<classpathentry kind="src" path="gen"/> | |
<classpathentry kind="output" path="bin/classes"/> | |
</classpath> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<classpath> | |
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> | |
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> | |
<classpathentry kind="src" path="src"/> | |
<classpathentry kind="src" path="gen"/> | |
<classpathentry kind="output" path="bin/classes"/> | |
</classpath> |
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
var add = function (add){ return add}; | |
var mul = function (mul){ return mul}; | |
var op = add || mul; | |
var applyf = function(op){ | |
if ( op === add) | |
return function(x){ |
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
var comments = document.querySelectorAll('#comment-list > li'); | |
var winners = {}; | |
getWinnerComment = function(id) { | |
return document.querySelectorAll('#' + id + ' .comment-content p')[0].textContent; | |
} | |
var iterations = 10000; | |
while(iterations--){ |
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
return movieLists. | |
concatMap(function(category){ | |
debugger; | |
return category.videos.concatMap(function(video){ | |
debugger; | |
return video.boxarts.filter(function(box){ | |
//safe coercion | |
return box.width=='150' | |
}).map(function(box){ | |
debugger; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
<script src="https://code.jquery.com/jquery-2.1.3.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/rxjs/2.3.25/rx.all.js"></script> | |
<script src="script.js"></script> | |
</head> |
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
// Code goes here | |
window.onload = function() { | |
var Observable = Rx.Observable; | |
var textbox = document.getElementById('textbox'); | |
var keypresses = Observable.fromEvent(textbox, 'keypress'); | |
var results = document.getElementById('results'); | |
var searchButton = document.getElementById('searchButton'); | |
var searchButtonClicks = Observable.fromEvent(searchButton, 'click'); | |
function getWikipediaSearchResults(term) { |
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
return movieLists.map( | |
// map receives 3 args | |
// cat - element to iterate | |
// cIndex - index in the array of the element | |
// cCollection - movieLists array | |
// same applies for the rest if the code | |
(cat, cIndex, cCollection) => { | |
//v for videos object | |
return cat.videos.map ( (v,vIndex,vCollection) => { |