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
ye sure, | |
//adding first time model to viewer | |
------------------------------------------------------------ | |
var longitude,latitude,altitudeCode,timestamp,heading; | |
altitudeCode = (altitudeCode * 0.3048); | |
var start = Cesium.JulianDate.fromDate(new Date(timestamp * 1000)); | |
var time = Cesium.JulianDate.addSeconds(start, 0, new Cesium.JulianDate()); |
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 declareOfNum(number,tiles = ['го','х','и','а']){ | |
let num = typeof number === 'string' ? +number : number; | |
let lastNum = num % 10; | |
return lastNum ? (lastNum > 1 && lastNum < 5 && tiles[1] || lastNum > 4 && tiles[2] || tiles[0]) : lastNum === 0 && tiles[num > 100 ? ((num + '')[1] === '0' ? 3 : 2) : 2] || 'NaN'; | |
} |
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
let moment = require('moment-timezone') || require('moment'); | |
moment.prototype.weekOfMonth = function weekOfMonth(m) { // eslint-disable-line | |
return this.week() - moment(this).startOf('month').week() + 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
if (!Array.prototype.last){ //last element of Array :) If you like to write better .last() then [array.length-1] | |
Array.prototype.last = function(){ | |
return this[this.length - 1]; | |
}; | |
}; | |
if (!Array.prototype.first){ //similarly, but first element of array [0] | |
Array.prototype.first = function(){ | |
return this[0]; |
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
Element.prototype.remove = function () { | |
this.parentElement.removeChild(this); | |
}; | |
NodeList.prototype.remove = HTMLCollection.prototype.remove = function () { | |
for (var i = this.length - 1; i >= 0; i--) { | |
if (this[i] && this[i].parentElement) { | |
this[i].parentElement.removeChild(this[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
$ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53); | |
$ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19); | |
$ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22); | |
$ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06); | |
$ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035); | |
$ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335); | |
$ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94); | |
$ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1); | |
$ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1); | |
$ease-out-quint: cubic-bezier(0.23, 1, 0.32, 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
const _validators = { | |
required: value => !!value.length, | |
'min-length': (value, min) => value.length >= +min, | |
'max-length': (value, max) => value.length <= +max, | |
number: value => isNaN(+value), | |
equals: (value, equals) => value === equals, | |
regexp: (value, regexp) => new RegExp(regexp).test(value), | |
} | |
/** |
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
git remote rm origin | |
git remote add origin https://<USERNAME>:<MYTOKEN>@github.com/<COMPANY/USERNAME>/<PROJECT>.git |
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 { BASE_URL } from 'api' | |
let abortableRequests = {} | |
const createRequest = ( | |
method, | |
path, | |
{ body, successStatus, abortableKey } = {} | |
) => { | |
let request = new XMLHttpRequest() |
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
console.logObject = function(...args) { | |
const log = args.reduce((logs, object, index) => { | |
if (typeof object === 'object' && !(object instanceof Array)) { | |
logs.push(`\r\n{ `) | |
logs.push.apply( | |
logs, | |
Object.keys(object).reduce((values, key) => { | |
values.push( | |
`\r\n ${key}:`, | |
typeof object[key] === 'function' ? '[function]' : object[key], |
OlderNewer