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
// HOWTO: load LABjs itself dynamically! | |
// inline this code in your page to load LABjs itself dynamically, if you're so inclined. | |
(function (global, oDOC, handler) { | |
var head = oDOC.head || oDOC.getElementsByTagName("head"); | |
function LABjsLoaded() { | |
// do cool stuff with $LAB here | |
} |
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
#!/bin/bash | |
NODE_VERSION=0.4.10 | |
NPM_VERSION=1.0.22 | |
sudo apt-get update | |
sudo apt-get install -y build-essential git-core nginx libssl-dev pkg-config curl | |
# Install node | |
mkdir -p $HOME/local/node | |
git clone git://github.com/joyent/node.git |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mongodb data-store | |
# Description: starts mongodb using start-stop-daemon |
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
jQuery(function(){ | |
jQuery('input[type=submit]').click(function(evt){ | |
evt.preventDefault(); | |
var string = jQuery('input[type=text]').val(); | |
var simpleParser = {}, | |
advancedParser = {}, | |
wonderfulParser = {}; | |
PARSER.call(simpleParser); |
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 Forma = function(){}; | |
Forma.prototype = { | |
getArea: function() | |
{ | |
console.log('Get Area from Forma'); | |
} | |
}; | |
var Cuadrado = function() | |
{ |
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 isMobile = function() { | |
var result = false; | |
for (var i = 0, len = SUPPORTED_OS.length; i < len && !result; i++) { | |
var mobile_os = SUPPORTED_OS[i]; | |
$.os[mobile_os] && (result = true); | |
} | |
return isMobile = result; | |
}; |
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() { | |
var google, nock, req, request; | |
request = require('http').request; | |
nock = require('nock'); | |
google = nock("www.google.com").get('/').reply(200, { | |
response: "ok!" | |
}); |
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
class I18n | |
constructor: (@dicc={}) -> | |
_: (text) -> | |
@dicc[text] or text | |
browserLanguage = navigator.language || | |
navigator.userLanguage || | |
'en' |
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
system = require('system') | |
## | |
# Wait until the test condition is true or a timeout occurs. Useful for waiting | |
# on a server response or for a ui change (fadeIn, etc.) to occur. | |
# | |
# @param testFx javascript condition that evaluates to a boolean, | |
# it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | |
# as a callback function. | |
# @param onReady what to do when testFx condition is fulfilled, |
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
task 'build:client:jade', 'Compile Jade template to generate AMD complient modules', (file) -> | |
dir = "#{__dirname}/application/templates" | |
readdir dir, (err, files) -> | |
throw err if err | |
files.forEach (file, index) -> | |
console.log "application/templates/#{file}" | |
module = "define(function(require){var template = {{compiled}};return template;});" | |
template = readFileSync "#{dir}/#{file}", 'utf8' | |
compiled = module.replace /{{compiled}}/, jade.compile(template, client: true).toString() | |
writeFileSync "#{__dirname}/public/js/internal/templates/#{file.replace /.jade/, '.js'}", compiled, 'utf8' |
OlderNewer