Skip to content

Instantly share code, notes, and snippets.

View web20opensource's full-sized avatar
🎯
Focusing

Mario Ruiz web20opensource

🎯
Focusing
View GitHub Profile
@web20opensource
web20opensource / testSuperHerojs11.js
Last active December 23, 2015 22:29
testing mootools (validation, checked, input, label)
/**
* 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();
<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 );
}
<?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>
<?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>
@web20opensource
web20opensource / gist:5410388
Created April 18, 2013 05:38
Is this a validated response about the last minutes from the video of Doug Crawford at mjg.in? http://frontendmasters.com/courses/javascript-the-good-parts/douglas-crockfords-function-challenges/
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){
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--){
@web20opensource
web20opensource / ex14
Created April 21, 2015 15:26
Learning RxJs
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;
<!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>
@web20opensource
web20opensource / script.js
Last active August 29, 2015 14:19 — forked from 1Marc/script.js
// 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) {
@web20opensource
web20opensource / ex12
Last active August 29, 2015 14:19
Learning RxJs
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) => {