Skip to content

Instantly share code, notes, and snippets.

View svetlio's full-sized avatar

Svetoslav Stoyanov svetlio

View GitHub Profile
@svetlio
svetlio / 50-cloud-init.yaml
Last active January 3, 2021 01:42
Netplan config bridge - ubuntu-server-18.04, and ex. default lxd profile
# located at /etc/netplan/
# $ sudo netplan apply
network:
version: 2
renderer: networkd
ethernets:
enp5s0f0:
dhcp4: false
bridges:
br0:
@svetlio
svetlio / ngx-datatable-html-select-update-value.ts
Created March 13, 2018 15:21
ngx-datatable html select update value
/**
* Update select list (html select)
*/
updateValueList(event, cell, rowIndex, row) {
var data = {
//"nid": [{"value": row.nid}],
"type":[{"target_id":"request_material"}],
"field_req_material_state": [{"value": event.target.value}]
};
@svetlio
svetlio / no-dbl-click-mat.directive.ts
Last active January 16, 2025 12:32
Angular 5 directive - Prevent double click for html button (no-dbl-click.directive.ts), and material mat-button (no-dbl-click-mat.directive.ts)
import { Directive, HostListener } from '@angular/core';
@Directive({
selector: '[appNoDblClickMat]'
})
export class NoDblClickDirectiveMat {
constructor() { }
@HostListener('click', ['$event'])
@svetlio
svetlio / SerializerCount.php
Last active February 12, 2020 22:13
Drupal 8 views rest with pager data
<?php
// thanks Dan - http://www.mediacurrent.com/blog/eight-insights-and-useful-snippets-d8-rest-module
/** @file
* Contains \Drupal\views_ext\Plugin\views\style\SerializerCount.
*/
namespace Drupal\views_ext\Plugin\views\style;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableDependencyInterface;
@svetlio
svetlio / SA-CORE-2013-003.nginx
Last active August 12, 2018 09:35
SA-CORE-2013-003 for nginx
# add on active server block
location ~* /(files|files-private|tmp)/.*\.php$ {
deny all;
}