Skip to content

Instantly share code, notes, and snippets.

View DimitarChristoff's full-sized avatar

Dimitar Christoff DimitarChristoff

View GitHub Profile
@DimitarChristoff
DimitarChristoff / Composer-moo.js
Created January 30, 2012 12:50
composer test via ovcerloadSetter
/**
* Composer.js is an MVC framework for creating and organizing javascript
* applications. For documentation, please visit:
*
* http://lyonbros.github.com/composer.js/
*
* -----------------------------------------------------------------------------
*
* Copyright (c) 2011, Lyon Bros Enterprises, LLC. (http://www.lyonbros.com)
*
@DimitarChristoff
DimitarChristoff / bootstrap-scrollspy.js
Created February 5, 2012 19:19
initial draft of a scroll spy like in twitter by arian. to be made more like js garden one.
var BootstrapScrollSpy = new Class({
initialize: function(element, wrapper){
element = this.element = document.id(element);
this.wrapper = wrapper || window;
var links = this.links = element.getElements('a');
var elements = this.elements = [];
links.each(function(el){
@DimitarChristoff
DimitarChristoff / Asset.templates.js
Created February 8, 2012 12:24
Loading a bunch of external templates through mootools
/*
---
name: Asset.templates
description: lazy-loading templates via Request.HTML and storing them for later under a key
authors: Dimitar Christoff
license: MIT-style license.
version: 1.1
requires:
- Core/Request
@DimitarChristoff
DimitarChristoff / outerclick.js
Created February 17, 2012 11:21
Element.Events.outerClick
Element.Events.outerClick = Element.Events.outerClick || {
base : 'click',
condition : function(event){
event.stopPropagation();
return false;
},
onAdd : function(fn){
this.getDocument().addEvent('click', fn);
},
onRemove : function(fn){
@DimitarChristoff
DimitarChristoff / product map
Created March 16, 2012 14:50
prototype for json
var foo = {
"Section": {
type: "subHeading",
output: "Insurance Provider",
values: [
{
type: "image",
value: "imagesrouce.gif"
},
{
@DimitarChristoff
DimitarChristoff / buttontext.js
Created March 21, 2012 10:12
flipping button values
var flipText = function(el, map) {
e.set('text', map[el.get('text').clean()];
};
flipText(document.getElement("button"), {
"No Email": "With Email",
"With Email": "No Email"
});
@DimitarChristoff
DimitarChristoff / buster-test.js
Created March 30, 2012 08:52
failing buster.js setUp async delay before testing
buster.testCase('dummy async test', {
setUp: function(done) {
var self = this;
this.yes = false;
setTimeout(function() {
self.yes = true;
done();
}, 3000);
},
if (range == -200) {
indx = 0;
range = 0;
}
else {
if (range < 0 && range > -199) {
indx = 0;
}
else {
if (range <= this.options.scores[0]) {
@DimitarChristoff
DimitarChristoff / refutal.md
Created April 29, 2012 11:46
why jquery is not better than mootools

saw this artcile quoting 10 reasons why jquery is better than mootools. source: http://www.jquery4u.com/articles/jquery-mootools/

jQuery has better mobile support than Mootools – the latest release of jQuery Mobile Alpha 3 has been a breakthrough in how easy it can be to get your website “mobile efficient”. Mootools has mobile support including touch events but it’s not as widely available as jQuery options. (#1 was Previously jQuery vs Mootools filesizes).

not true. see http://moobilejs.com/

jQuery is less confusing than Mootools! – It has less native extensions (including element) – jQuery has about a dozen for Array, Object, and String and Mootools has about six dozen for Array, Object, String, Function, and Number.

how is less power and methods a good thing? the reason why mootools has more native methods is because it also shims browsers that lack ES5 functionality for all the natives that it extends. if anything, this goes against jquery.