Skip to content

Instantly share code, notes, and snippets.

View Aleksey-Danchin's full-sized avatar

Алексей Данчин Aleksey-Danchin

View GitHub Profile
[
{"id": 1, "name": "Алексей", "family": "Владиклат", "phone": "1234252"},
{"id": 2, "name": "Дмитрий", "family": "Карий", "phone": "82564"},
{"id": 3, "name": "Александр", "family": "Точка", "phone": "668733"},
{"id": 4, "name": "Сергей", "family": "Курм", "phone": "477345"},
{"id": 5, "name": "Мария", "family": "Ом", "phone": "146782"},
{"id": 6, "name": "Сергей", "family": "Актор", "phone": "488175"}
]
@Aleksey-Danchin
Aleksey-Danchin / data.json
Created October 10, 2018 07:08
data.json
{
"name": "Алексей",
"family": "Данчин"
}
@Aleksey-Danchin
Aleksey-Danchin / Форма
Created June 25, 2018 17:08
Доделать сайты
Доработка по сайту Landing Page
Добавить:
1) Отзывы
2) Меню
3) Группу вконтакте
4) Footer с контактами социальных сетей
5) Опечатка на октября
6) Оставить свои контакты
{
"presons": [
{
"name": "Дмитрий",
"family": "Фавлен",
"bithday": [1992, 4, 2]
},
{
"name": "Александр",
"family": "Карам",
{
"presons": [
{
"name": "Дмитрий",
"family": "Фавлен",
"bithday": [1992, 4, 2]
},
{
"name": "Александр",
"family": "Карам",
{
"name": "Aleksey",
"family": "Danchin"
}
@Aleksey-Danchin
Aleksey-Danchin / game.html
Created June 4, 2018 10:26
Декларативное описание игры
<game type="rpg">
<objects>
<unit tag="warrior" tileset="/src/unit/warrior/tileset.png" atlas="/src/unit/warrior/tileset.png" action-default="wait" />
<build tag="barrack" tileset="/src/build/barrack/tileset.png" atals="/src/build/barrack/tileset.png" action-default="wait" />
</objects>
<fraction name="Alex" color="red">
<resource type="wood" count="150" />
<resource type="water" count="100" />
<resource type="gold" count="100" />
@Aleksey-Danchin
Aleksey-Danchin / Array.prototype.js
Created April 22, 2018 08:34
prototype expansion
Object.defineProperty(Array.prototype, 'first', {
get () {
return this[0]
},
set (val) {
if (!this.length) {
this.push(val)
return val
}
// Обновление
sudo apt-get update
sudo apt-get upgrade
// Установка приложений
sudo apt-get install vim git tree traceroute
// Установка nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
@Aleksey-Danchin
Aleksey-Danchin / Randomer.js
Created April 26, 2017 09:19
Генератор рандомера по фиксированному множеству вероятностей.
function getRandomer(...chances) {
const commonLength = chances.reduce((p, c) => p + c, 0)
, chancesLength = chances.length;
return function() {
const rIndex = Math.floor(Math.random() * commonLength);
let startIndex = - 0.5, lastIndex;
for (let i = 0; i < chancesLength; i++) {
lastIndex = startIndex + chances[i];