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 GetQuadraticFunction (a, b, c, d) { | |
return (function (a, b, c, d) { | |
function init (value, defaultValue) { | |
value = parseFloat(value); | |
if (Number.isNaN(value) || !Number.isFinite(value)) { | |
value = defaultValue; | |
} | |
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 getRandomName () { | |
var minNameLength = 5, | |
maxNameLength = 11; | |
var vowels = 'aeiouy', | |
consonants = 'bcdfghjklmnpqrstvwxyz', | |
probability = {vowel: 4, consonant: 6}, | |
totalProbabitily = probability.vowel + probability.consonant; | |
var nameLength = minNameLength + Math.floor(Math.random() * (maxNameLength - minNameLength + 1)); |
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
// It's a kind of magic JavaScript (part 1) | |
['10', '10', '10'].map(parseInt); // [ 10, NaN, 2 ] | |
['10', '10', '10'].map(Number); // [ 10, 10, 10 ] |
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
(-> | |
"use strict" | |
angular | |
.module "internetModule", [] | |
.factory "internet", ['$rootScope', | |
($rootScope) -> | |
$rootScope.internet = {} | |
] |
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
/* | |
* Project: 'My first Arduino Project.' | |
* Description: 'Work by a lesson.' | |
* Autor: 'Aleksey Danchin' | |
* Date: '24.11.2014' | |
* Links: | |
* Lesson 1 (in Russian) | |
* http://www.youtube.com/watch?v=bO_jN0Lpz3Q#t=773 | |
*/ |
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
<canvas id="canvasElement"></canvas> | |
<script> | |
var canvas = document.getElementById('canvasElement'), | |
context = canvas.getContext('2d'), | |
radius = 300, d_qu = 0; | |
setInterval(function () { | |
d_qu += 0.06; |
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
<canvas id="canvasElement" style="border: 1px solid black;"></canvas> | |
<script> | |
setup(); gameLooping = setInterval(loop, 180); | |
//////////////////////////////////////////////////////////// | |
var gameLooping, canvas, context, sideOfSquare, head, snake, tail, direct, moved, points, eat; | |
//////////////////////////////////////////////////////////// |
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
<canvas id="canvasElement" style="border: 1px solid black;"></canvas> | |
<script> | |
setup(); gameLooping = setInterval(loop, 0); | |
//////////////////////////////////////////////////////////// | |
var gameLooping, canvas, context, mouseX, mouseY, PI2, state, color, d, r, g, b; | |
//////////////////////////////////////////////////////////// |
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
<canvas id="canvasElement" style="border: 1px solid black;"></canvas> | |
<script> | |
setup(); gameLooping = setInterval(loop, 0); | |
//////////////////////////////////////////////////////////// | |
var gameLooping, canvas, context, mouseX, mouseY, PI2, circleR, circleB, circleG, mouseColor; | |
//////////////////////////////////////////////////////////// |
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
<canvas id="canvasElement" style="border: 1px solid black;"></canvas> | |
<script> | |
setup(); gameLooping = setInterval(loop, 0); | |
//////////////////////////////////////////////////////////// | |
var gameLooping, canvas, context, mouseX, mouseY, PI2, controlCircles, cirlce; | |
//////////////////////////////////////////////////////////// |
OlderNewer