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
" ============================================================================= | |
" Miller Medeiros .vimrc file | |
" ----------------------------------------------------------------------------- | |
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory, ... | |
" ============================================================================= | |
" ----------------------------------------------------------------------------- | |
" BEHAVIOR |
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
/*! | |
* RequireJS plugin for loading JSON files | |
* - depends on Text plugin and it was HEAVILY "inspired" by it as well. | |
* | |
* IMPORTANT: it only works on r.js optimizer after version 0.26+ 20011/09/27 | |
* | |
* @author Miller Medeiros | |
* @version 0.0.1 (2011/06/10) | |
* Released under the WTFPL <http://sam.zoy.org/wtfpl/> | |
*/ |
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
(function(def){ | |
def('myModule', ['someDependency', 'somethingElse'], function(someDependency, somethingElse){ | |
//return the module's API | |
return {}; | |
}); | |
}( | |
// wrapper to run code everywhere | |
typeof define === 'function' && define.amd? |
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
({ | |
//settings for the r.js optimizer | |
baseUrl : '../js', | |
name : 'main', | |
out : '../deploy/js/main-v2.js', //here you can set the versioning | |
excludes : [ | |
//so we can load those modules only when needed, also to make sure | |
//individual versioning of sections also work as expected. | |
'sections/search/main', | |
'sections/news/main', |
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
define(['jquery'], function($){ | |
var DEFAULT_DATA_TYPE = 'json'; | |
/** | |
* Abstract REST service model. | |
* @author Miller Medeiros | |
* @version 0.3.1 (2011/09/21) | |
* @param {object} [services] Services | |
* @see AbstractModel.services |
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> | |
<meta charset="utf-8"> | |
<title>Example</title> | |
<meta name="description" content="This is just an example"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="css/main.css"> | |
</head> | |
<body data-modules="foobar, lorem/ipsum"> |
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
//create our "FOO" namespace | |
window.FOO = window.FOO || {}; | |
FOO.app1 = { | |
bar : 'foo', | |
init : function(){ | |
//this wont work as expected since timeout changes scope |
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
// ----------------------- | |
// refactor by Miller Medeiros (http://blog.millermedeiros.com) | |
// of code samples present on position-absolute.com blog post: | |
// http://www.position-absolute.com/articles/organizing-events-with-jquery/ | |
// ----------------------- | |
//just so we make sure `myApp` does exist | |
window.myApp = window.myApp || {}; |
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> | |
<meta charset="utf-8"> | |
<title>example crossroads + hasher</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
</head> | |
<body> | |
<div id="wrapper"> | |
<ul> |
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
//set location of "noext!" plugin | |
//(this setting should be on the top-level of your app, inside your "main.js" or HTML file) | |
//you could also omit this setting and just place the "ext.js" file in the `baseUrl` folder. | |
require({ | |
paths : { | |
noext : 'path_to_plugin/noext' | |
} | |
}); | |
//load file without appending ".js" extension |