Skip to content

Instantly share code, notes, and snippets.

@alexd73
alexd73 / docker-compose.yml
Created March 24, 2020 07:51
d4d traefik v2 https (сгенерировать как тут https://niklan.net/blog/172#podderzhka-https)
nginx:
image: wodby/nginx:$NGINX_TAG
container_name: "${PROJECT_NAME}_nginx"
depends_on:
- php
environment:
NGINX_STATIC_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_SERVER_ROOT: /var/www/html/web
@alexd73
alexd73 / docker-compose.yml
Created March 24, 2020 07:51
d4d traefik v2 https
nginx:
image: wodby/nginx:$NGINX_TAG
container_name: "${PROJECT_NAME}_nginx"
depends_on:
- php
environment:
NGINX_STATIC_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_SERVER_ROOT: /var/www/html/web
@alexd73
alexd73 / index.html
Created November 2, 2019 19:55
ribbon css
<div class="ribbon-container">
<h2 class="title ribbon">
<div class="ribbon-content">{{ model.title }}</div>
</h2>
</div>
@alexd73
alexd73 / DigitItem.vue
Last active October 29, 2019 16:54
Компонент для промотки чисел от и до (`npm install --save vue-observe-visibility и gsap`)
<template>
<div
v-observe-visibility="{
callback: visibilityChanged,
}"
class="digit-item"
>test {{digit}}</div>
</template>
<script lang="ts">
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
export CUSTOM_BARRIO=$1 # change this to your custom theme_name
cp -r ../contrib/bootstrap_sass $CUSTOM_BARRIO
cd $CUSTOM_BARRIO
for file in *bootstrap_sass.*; do mv $file ${file//bootstrap_sass/$CUSTOM_BARRIO}; done
for file in config/*/*bootstrap_sass.*; do mv $file ${file//bootstrap_sass/$CUSTOM_BARRIO}; done
grep -Rl bootstrap_sass .|xargs sed -i'' -e "s/bootstrap_sass/$CUSTOM_BARRIO/"
grep -Rl bootstrap_barrio .|xargs sed -i'' -e "s/bootstrap_barrio/$CUSTOM_BARRIO/"
@alexd73
alexd73 / extra patches
Last active February 8, 2019 12:56
composer.jsom
"drupal/block_styles": {
"Notice: Undefined index after placing block": "https://www.drupal.org/files/issues/2642010-7-fix-block-notice.patch",
"Notice: Undefined index: #id in block_styles_theme_suggestions_block_alter() ": "https://www.drupal.org/files/issues/notice_undefined-2725167-3.patch",
"array flip issue": "https://www.drupal.org/files/issues/2018-06-23/2890458_fix_array_flip.patch"
},
"drupal/ds": {
"Warning: Invalid argument supplied for foreach() in /ds/ds.module on line 504": "https://www.drupal.org/files/issues/2018-04-21/invalid_argument_in_ds_module-2904575-7.patch"
},
"drupal/owlcarousel": {
"Theme hook owl not found (solved)": "https://www.drupal.org/files/issues/drupal-8_owlcarousel_theme_hook_owl_not_found_2917939-2.patch"
@alexd73
alexd73 / drone.service
Last active February 8, 2019 12:33
create service with docker-compose in ubuntu
# /etc/systemd/system/drone.service
[Unit]
Description=Drone server
After=docker.service nginx.service
[Service]
Restart=always
ExecStart=/usr/local/bin/docker-compose -f /etc/drone/docker-compose.yml up
ExecStop=/usr/local/bin/docker-compose -f /etc/drone/docker-compose.yml stop
@alexd73
alexd73 / keybindings.json
Last active November 8, 2018 14:13
Настройки vscode
[
{
"key": "shift+numpad2",
"command": "cursorDownSelect",
"when": "textInputFocus"
},
{
"key": "shift+numpad1",
"command": "cursorEndSelect",
"when": "textInputFocus"
<?php
/**
* Убирает из массива элемент по его значению
* @param $arr
* @param $value
*/
function unset_by_value(&$arr, $value){
if (($key = array_search($value, $arr)) !== false) {
unset($arr[$key]);
}