Skip to content

Instantly share code, notes, and snippets.

View LordJohn42's full-sized avatar
🪆

Eugene LordJohn42

🪆
View GitHub Profile
@LordJohn42
LordJohn42 / Debug form snipper
Created April 25, 2016 10:30
Debug form snipper
[].forEach.call(document.querySelectorAll('form'), function (input) {
var table = [];
console.group('HTMLForm "' + input.name + '": ' + input.action);
console.log('Element: ', input, '\nName: ' +
input.name + '\nMethod: ' + input.method.toUpperCase() +
'\nAction: ' + input.action || 'null');
['input', 'textarea', 'select'].forEach(function (control) {
[].forEach.call(input.querySelectorAll(control), function (node) {
@LordJohn42
LordJohn42 / example.html
Created June 9, 2016 09:04
Checkbox group AngularJS.
<input checkbox-group="true" type="checkbox" id="checkbox-toogle-all">
<div id="checkBoxContainer" ng-repeat="selectedItem in list">
<input type="checkbox" checkbox-group/>
<label class="">{{selectedItem.value}}</label>
</div>
@LordJohn42
LordJohn42 / Directory structure
Created September 26, 2019 12:12
Angular code examples. Code show factory for uploading 3d models. Work with Observable & Protobuf.
├── components
│   ├── model-list
│   │   ├── model-list.component.html
│   │   ├── model-list.component.scss
│   │   ├── model-list.component.spec.ts
│   │   └── model-list.component.ts
│   ├── models3d-layout
│   │   ├── models3d-layout.component.spec.ts
│   │   └── models3d-layout.component.ts
│   └── upload-model
@LordJohn42
LordJohn42 / Flower.vue
Last active September 26, 2019 12:32
Vue component for d3 hexagonal view. (Выглядит примерно так https://www.d3-graph-gallery.com/img/graph/hexbinmap_geo_basic.png)
<template>
<div>
<div class="row">
<div class="col-sm-12">
<div class="content-header">Цветок</div>
</div>
</div>
<section id="grid-option">
<div class="row">
@LordJohn42
LordJohn42 / Container.php
Last active September 26, 2019 14:37
PHP code examples.
<?php
// Simple container
// Простая реализация контейнера.
namespace System\Container;
use Psr\Container\ContainerInterface;
use ReflectionClass;
use ReflectionException;
@LordJohn42
LordJohn42 / cloudSettings
Last active September 17, 2021 13:46
cloudSettings
{"lastUpload":"2021-09-17T13:46:27.874Z","extensionVersion":"v3.4.3"}
# Yarn
alias yarnbd='yarn build-dev'
alias yarnb:d='yarn build:dev'
# Composer
alias compi='composer install'
# PM2
alias pm2checklogs='pm2 logs checkout --raw --lines 50'
alias pm2new_design='pm2 logs checkout --raw --lines 50'
# Dir's hacks
alias ..="cd .."
Задача на стейк с двумя пивами:
Есть игровое поле 5x5
X X X X X
X X X X X
X X X X X
X X X X X
При нажатии на клетку из игры, должны занятся и соседние клетки тоже