This file contains hidden or 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
/** | |
Encrypt this string. | |
@function crypt | |
@member {@builtin String}.prototype | |
@see {@link {@builtin String}} | |
@param {string} salt | |
*/ | |
String.prototype.crypt = function(salt) { | |
} |
This file contains hidden or 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 ctm() { var u = 'undefined'; return ((typeof document.querySelector !== u) && (typeof localStorage !== u) && (typeof window.addEventListener !== u)) ? true : false;} | |
function ctm() {var u='undefined';return typeof document.querySelector!==u && typeof localStorage!==u && typeof window.addEventListener!==u ? true:false;} | |
function ctm(){return 'querySelector' in document && 'localStorage' in window && 'addEventListener' in window ? true:false} | |
function ctm(){try{return 'querySelector' in document && 'localStorage' in window && 'addEventListener' in window ? true:false;}catch(){return false}} | |
function ctm(){return 'querySelector' in document && 'localStorage' in window && 'addEventListener' in window} |
This file contains hidden or 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>post</title> | |
<script src="http://easyxdm.net/current/easyXDM.min.js"></script> | |
<script> | |
var socket = new easyXDM.Socket({ | |
remote: "http://b.example.com/provider.html", | |
onReady: function(){ |
This file contains hidden or 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
/** | |
* A module for retrieving information about Photos from Foursquare. | |
* @module "node-foursquare.Photos" | |
*/ | |
/** | |
* Create a new Photos object. | |
* @constructor | |
* @param {Object} config A valid configuration. |
This file contains hidden or 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
/** | |
* Construct the Foursquare.Photos module. | |
* @param {Object} config A valid configuration. | |
* @module node-foursquare/Photos | |
*/ | |
module.exports = function(config) { | |
var core = require("./core")(config), | |
logger = require('log4js')(config.log4js).getLogger("node-foursquare.Photos"); | |
/** |
This file contains hidden or 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 x = 1; | |
function Foo() { | |
this.x = 2; | |
function bar() { | |
console.log(this.x); //=> 1 | |
} | |
bar(); | |
var zop = function() { |
This file contains hidden or 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 escapeHtml(str) { | |
return str.toString().replace(/</g, "<").replace(/>/g, ">").replace(/&(\s)/g, "&$1"); | |
} | |
function prepareCodeExample(str) { | |
str = str.toString(); | |
//remove blank lines at the start and end of the example | |
var description = str.match(/^\s*.*\s*()/) | |
str = str.replace(/^(\s*[\r\n]+)+/, "").replace(/([\r\n]+\s+)+$/, ""); | |
//read the space at the start for the 1st line of code |
This file contains hidden or 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
gloader.load( | |
["glow", "1"], | |
{ | |
onLoad: function(glow) { // will run whenever the glow code arrives | |
// make this glow global | |
window.glow = glow; | |
} | |
} | |
); |
This file contains hidden or 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
Make two file requests for two modules | |
---- | |
This is the current state of our RequireJS usage. The map is automatically | |
generated by the BBC Mapper application. This is flexible and it works, however | |
it requires two downloads from the server. | |
// map module ids to urls | |
require({ | |
'swfobject-1': 'exact/path/1.2.3/swfobject.js', |
This file contains hidden or 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('coolplug-1', function() { | |
// sandbox function | |
return function($) { | |
//---- usual plugin code starts here ---- | |
$.fn.cool = function() { alert('cool!'); } | |
//---- usual plugin code ends here ------ |