Skip to content

Instantly share code, notes, and snippets.

Miguel Castillo MiguelCastillo

Block or report user

Report or block MiguelCastillo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9873073
define(["require", "exports", "module"], function (require, exports, module) {
"use strict";
/*
* requirejs support in tern
*/
var ternRequire = window.require.config({
"baseUrl": require.toUrl("./tern/"),
"paths": {
"acorn": "node_modules/acorn"
@MiguelCastillo
MiguelCastillo / gist:9973772
Created Apr 4, 2014
Brackets loading CodeMirror addon
View gist:9973772
/**
* Brackets Themse Copyright (c) 2014 Miguel Castillo.
*
* Licensed under MIT
*/
define(function (require, exports, module) {
"use strict";
View gist:10595457
<html>
<head>
<script>
document.title = "From the 90s";
document.writeln("It has been a long time");
</script>
</head>
<body>
Welcome back Netscape!
@MiguelCastillo
MiguelCastillo / gist:10595702
Created Apr 13, 2014
contacts.html + inline script
View gist:10595702
<html>
<head>
<script>
document.title = "From the 90s - Contact";
document.writeln("It has been a long time");
document.writeln("Contacts");
document.writeln("Terminator");
document.writeln("Predator");
document.writeln("Robocop");
</script>
@MiguelCastillo
MiguelCastillo / gist:10596040
Last active Aug 29, 2015
First html with early encarnations of a module
View gist:10596040
<html>
<head>
<script src="app.js"></script>
<script src="common.js"></script>
<script src="utils.js"></script>
<script src="contacts.js"></script>
<script src="hiring.js"></script>
</head>
<body>
View gist:10608600
define(function() {
return {
"hello": "world";
};
});
@MiguelCastillo
MiguelCastillo / gist:10608677
Last active Aug 29, 2015
define with depedency
View gist:10608677
define([
"simple"
], function( simple ){
console.log( simple.hello );
})
@MiguelCastillo
MiguelCastillo / gist:10654916
Last active Aug 29, 2015
Modular design pattern
View gist:10654916
var Module = (function() {
var message = "Hello World"
function greetings() {
return console.log(message);
}
return {
greetings: greetings
};
@MiguelCastillo
MiguelCastillo / greetings.js
Last active Aug 29, 2015
RequireJS module
View greetings.js
define(function() {
var message = "Hello World"
function greetings() {
return console.log(message);
}
return {
greetings: greetings
};
@MiguelCastillo
MiguelCastillo / main.js
Last active Aug 29, 2015
Require dependency
View main.js
define( ["greetings"], function( greetings ) {
greetings.greetings();
});
You can’t perform that action at this time.