Skip to content

Instantly share code, notes, and snippets.

View Borodin's full-sized avatar
📷
http://tour-360.ru

Maxim Borodin Borodin

📷
http://tour-360.ru
View GitHub Profile
@Borodin
Borodin / output.md
Created October 23, 2024 12:09
test
Array (rows with minimal number marked with "*"):

   100  -16   51  -21  -34  -86  -77  -15  -18   50 | Smallest positive:  50 | Min changes: 2
*  -96  -30   94  -84  -80   56   82   26   80  -90 | Smallest positive:  26 | Min changes: 1
   -37  -63   89   39   56   85  -46   32  -11  -70 | Smallest positive:  32 | Min changes: 1
    28  -87   91   14   19  -85   65  -22  -51  -69 | Smallest positive:  14 | Min changes: 2
     0   97  -47   46    5   34  -77  -58   78    8 | Smallest positive:   5 | Min changes: 1
    38    9   58  -59   -8  -68   75   29  -17  -74 | Smallest positive:   9 | Min changes: 2
 -1 88 -72 92 -14 9 34 27 66 65 | Smallest positive: 9 | Min changes: 2
@Borodin
Borodin / form.js
Created June 1, 2017 11:40
Могут быть ошибки
var Forms = {
init: function() {
for (var i = 0; i < document.forms.length; i++) {
document.forms[i].addEventListener('submit', Forms.submit);
}
},
check: function(form) {
var flag;
var inputs = form.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
<img id=a onmousedown="return !1" onmouseup="r()" style="width:640px;height:480px"><script>h=p=t=0,r=function(b){a.src="http://maps.googleapis.com/maps/api/streetview?size="+(b?"160x120":"640x480")+"&location=54.9161,38.3013&heading="+parseInt(h)+"&fov=120&pitch="+parseInt(p)},window.onmousemove=function(a){a.buttons&&Date.now()-t>90&&(h-=a.movementX,p+=a.movementY,r(1),t=Date.now())};r()</script>
@Borodin
Borodin / tour.html
Last active November 25, 2016 17:25
<!DOCTYPE html>
<html>
<body>
<img id="a">
<style>
html, body{
margin: 0;
padding: 0;
}
img{
@Borodin
Borodin / date.html
Last active September 5, 2016 09:43
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="year">
</div>
<style>
var key = prompt('key:','123'),
msg = prompt('msg:','text'),
ans = confirm('[yes] - encoding, [no] - decoding')?1:-1;
prompt('rusult',msg.split('').map(function(n,k){return String.fromCharCode(n.charCodeAt(0)+(key.charCodeAt(k%key.length)*ans))}).join(''));
<!DOCTYPE html>
<body>
<button onclick="push(1)">1</button>
<button onclick="push(2)">2</button>
<button onclick="push(3)">3</button>
<span>— Добавляют элементы истории.</span>
<p>При удерживании кнопки ←, элементы истории смещены на 1.</p>
</body>
<script>
function push(title) {
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
@Borodin
Borodin / gist:8846366206c8987fbc84
Last active August 29, 2015 14:21
getDistance
var rad = function(x) {
return x * Math.PI / 180;
};
var getDistance = function(lat1, lng1, lat2, lng2) {
var R = 6378137;
var d_lat = rad(lat2 - lat1);
var d_lng = rad(lng2 - lng1);
var a = Math.sin(d_lat / 2) * Math.sin(d_lat / 2) +
Math.cos(rad(lat1)) * Math.cos(rad(lat2)) *
@Borodin
Borodin / iframe.html
Last active August 29, 2015 14:06
Tour-360.ru iframe code
<iframe src="http://tour-360.ru/projects/anticafemsk/?id=0&lon=-89.20&lat=-3.60&fov=70.00&autorotation=true" width="640" height="480" frameborder="no" scrolling="no" allowfullscreen></iframe>
<br><a href="http://tour-360.ru"><br><a href="http://tour-360.ru">Профессиональная съемка 3D панорам и создание виртуальных туров 360º</a>