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 Board(domEl, width, height, toWinCount) { | |
this.domEl = domEl; | |
this.width = width || 20; | |
this.height = height || 20; | |
this.toWinCount = toWinCount || 5; | |
this.board = undefined; | |
this.firstTurnTs = undefined; | |
this.turnsCount = undefined; | |
this.popupDomEl = this.domEl.querySelector('.popup'); | |
} |
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
.board { | |
border: 1px #000 solid; | |
width: 600px; | |
height: 600px; | |
} | |
.board .popup { | |
position: absolute; | |
opacity: 0.6; | |
background: #fff; | |
width: 600px; |
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>Tic-tac-toe</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<div class="result"></div> | |
<div class="board"> |
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"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Title</title> | |
<link rel="stylesheet" type="text/css" href="https://www.gosuslugi.ru/widgets/css/player.min.css" /> | |
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script> |
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
// 1. from http://www.2ality.com/2012/12/javascript-puzzle-equal.html | |
// question: | |
x === y // true | |
1/x > 1/y // true | |
// solution: | |
x = y = { count: 1, valueOf: function () { return this.count++; }}; | |
// 2. |
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
/* | |
* Drag and Drop | |
*/ | |
function DnD (element, settings) { | |
this.dragstartCallbacks = []; | |
this.dragCallbacks = []; | |
this.dragendCallbacks = []; | |
this.element = element; | |
this.settings = settings || {}; | |
if (this.settings.dragstart) { |
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"> | |
<style> | |
body { | |
padding: 10px; | |
background: #000; | |
} | |
.guide { |
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 result = | |
data.reduce(function(soFar, next) { | |
return { total: soFar.total + next, | |
count: soFar.count + 1 }; | |
}, | |
{total: 0, count: 0 } | |
); | |
var mean = result.total / result.count; |
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
///<reference path="../../DefinitelyTyped/underscore/underscore.d.ts" /> | |
///<reference path="../../DefinitelyTyped/jquery/jquery.d.ts" /> | |
import MapiRequest = require('../mapi/request.t'); | |
import request_i = require("../mapi/request.i"); | |
import mapi_i = require("../mapi.i"); | |
import user_account_i = require('./user_account.i'); | |
import IUserAccount = user_account_i.IUserAccount; | |
import IBalanceMapiResponse = user_account_i.IBalanceMapiResponse; |
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( | |
[ | |
'../page', | |
'template!templates/page/catalogue.mustache', | |
'src/widgets/catalogue', | |
'./catalogue/filter', | |
'underscore', | |
'stivi/models/catalogue_collection', | |
'config/app', | |
'src/popups/prompt' |
NewerOlder