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
/** | |
* Retrieve the variant to display. Should only be called once to ensure | |
* no double-counting of show events. | |
* | |
* @return {number} | |
*/ | |
Experiment.prototype.chooseVariant = function() { | |
var self = this; |
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> | |
<body> | |
<style> | |
body, html { | |
height: 100%; | |
width: 100%; | |
} | |
</style> | |
<div id=mapcontainer style="width: 100%; height: 100%;"></div> |
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
processTimes: function() { | |
var startDate = ''; | |
var startDisplay = 'Date to be announced'; | |
var startDisplayShort = 'TBA'; | |
var startCountdown = ''; | |
var startTime = 4100745600000; // Change this in 2099 | |
var startDiff = 99999999; | |
var duration = ''; | |
var durationWeeks = 1000; | |
var today = moment(new Date()); |
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
<style type="text/css"> | |
.hidden-accessible { | |
position: absolute !important; | |
height: 1px; width: 1px; | |
overflow: hidden; | |
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ | |
clip: rect(1px, 1px, 1px, 1px); | |
} | |
</style> |
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(wndw) { | |
var Browsers, OS, Platform, Versions, browser_name, browser_version, os, platform; | |
Versions = { | |
Firefox: /firefox\/([\d\w\.\-]+)/i, | |
IE: /msie\s([\d\.]+[\d])/i, | |
Chrome: /chrome\/([\d\w\.\-]+)/i, | |
Safari: /version\/([\d\w\.\-]+)/i, | |
Ps3: /([\d\w\.\-]+)\)\s*$/i, | |
Psp: /([\d\w\.\-]+)\)?\s*$/i | |
}; |
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 truncateText(string, nMaxChars) { | |
if (string.length <= nMaxChars) | |
return string; | |
var xMaxFit = nMaxChars - 3; | |
var xTruncateAt = string.lastIndexOf(' ', xMaxFit); | |
if (xTruncateAt == -1 || xTruncateAt < nMaxChars / 2) | |
xTruncateAt = xMaxFit; | |
return string.substr(0, xTruncateAt) + "…"; |
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 linkifyText(string){ | |
if (string) { | |
string = string.replace( | |
/((https?\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi, | |
function(url){ | |
var full_url = url; | |
if (!full_url.match('^https?:\/\/')) { | |
full_url = 'http://' + full_url; | |
} |
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 set_speed(speed) | |
* Set the video speed | |
* | |
* @param double speed - target speed | |
* | |
* @return void | |
*/ | |
this.is_set_speed_enabled = function(){ | |
if(typeof(this.mediaelement_media) === 'object' |
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
describe('catalogyBody', function() { | |
var chai = require('chai'); | |
var path = require('path'); | |
var env = require(path.join(testDir, 'lib', 'environment')); | |
var requirejs = env.requirejs(staticDir); | |
var sinon = requirejs('js/lib/sinon'); | |
var fs = require('fs'); | |
var server; | |
var router; |
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
import unittest | |
BUST_VAL = 22 | |
ACE_HIGH = 11 | |
ACE_LOW = 1 | |
def calculate_hand_val(low_hand_val, num_aces): | |
hand_val = low_hand_val | |
for x in range(1, num_aces + 1): |