Skip to content

Instantly share code, notes, and snippets.

View Yipee-ki-yay's full-sized avatar
🎯
Focusing

Oleksandr Morozov Yipee-ki-yay

🎯
Focusing
View GitHub Profile
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
// With Flutter, you create user interfaces by combining "widgets"
// You'll learn all about them (and much more) throughout this course!
class MyApp extends StatelessWidget {
const MyApp({super.key});
@Yipee-ki-yay
Yipee-ki-yay / docker_commands_sta
Last active September 2, 2020 09:47
docker commands from staq project
Команды для билда контейнера:
docker build -t registry.gitlab.com/staqru/staq -f docker/php-fpm-build/Dockerfile .
docker login registry.gitlab.com
docker push registry.gitlab.com/staqru/staq
docker-compose up
Для того, чтобы появились таблицы:
docker-compose exec php php artisan migrate
@Yipee-ki-yay
Yipee-ki-yay / pluralize-ru.js
Created August 4, 2020 09:37
JavaScript - Plural forms for russian words
/**
* Plural forms for russian words
* @param {Integer} count quantity for word
* @param {Array} words Array of words. Example: ['депутат', 'депутата', 'депутатов'], ['коментарий', 'коментария', 'комментариев']
* @return {String} Count + plural form for word
*/
function pluralize(count, words) {
var cases = [2, 0, 1, 1, 1, 2];
return count + ' ' + words[ (count % 100 > 4 && count % 100 < 20) ? 2 : cases[ Math.min(count % 10, 5)] ];
}
@Yipee-ki-yay
Yipee-ki-yay / docker_commands.txt
Last active March 29, 2020 13:34
run project with docker
1. cd /var/www/html/docker
2. sudo docker-compose up -d
how to make composer install or php artisan migrate on site:
1. sudo docker ps
2. ищешь docker_app, и берешь CONTAINER ID, копируешь его
3. sudo docker exec -ti 8d8942597c2d /bin/bash
4. cd excursions.back/
5. composer install
@Yipee-ki-yay
Yipee-ki-yay / Inheritance properties
Created March 28, 2019 06:42
Наследование копированием свойств
/* Поверхностное копирование */
function extend(parent, child) {
var i;
child = child || {};
for (i in parent) {
if(parent.hasOwnProperty(i)) {
child[i] = parent[i];
}
}
return child;
@Yipee-ki-yay
Yipee-ki-yay / templateModule.js
Created March 3, 2019 11:02
template "open module"
MYAPP.utilities.array = (function() {
// зависимости
var uobj = MYAPP.utilities.object,
ulang = MYAPP.utilities.lang,
// частные свойства
array_string = "[object Array]",
ops = Object.prototype.toString;
// частные методы
@Yipee-ki-yay
Yipee-ki-yay / classicInherit.js
Last active March 24, 2019 07:32
Ожидаемые результаты при использовании классического наследования
// родительский конструктор
function Parent(name) {
this.name = name || 'Adam';
}
// добавление дополнительной функциональности в прототип
Parent.prototype.say = function() {
return this.name;
}
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+shift+q",
"command": "workbench.action.quickOpenView"
},
{
"key": "ctrl+shift+i",
"command": "xandeer.aligncode",
"when": "editorTextFocus"
@Yipee-ki-yay
Yipee-ki-yay / .stylelintrc
Last active December 23, 2018 16:06
stylelintrc + stylelint-order
{
"plugins": [
"stylelint-order"
],
"rules": {
"at-rule-empty-line-before": [ "always", {
except: [
"blockless-after-same-name-blockless",
"first-nested",
],
@Yipee-ki-yay
Yipee-ki-yay / instruction.txt
Last active December 16, 2019 10:15
how to init project on local server
1. Добавить каталог в html
2. Прописать ip в etc/hosts
3. Добавить conf файл в etc/apache2/sites-available (sudo cp /etc/apache2/sites-available/energy.full.conf /etc/apache2/sites-available/technostock.loc.conf)
4. Добавить conf файл в etc/apache2/sites-enabled (sudo a2ensite caps.full.conf)
5. Перезапустить апач (sudo service apache2 restart)
6. Настроить .env, .htaccess
7. Создать БД http://localhost/phpmyadmin/
8. Уточнить права доступа в определенной директории (sudo chmod -R 777 *)
9. Установить пакеты (composer install)
10. Сгенерировать ключ для приложения (php artisan key:generate)