Skip to content

Instantly share code, notes, and snippets.

View Yurii-Chaban's full-sized avatar

Yurii Chaban Yurii-Chaban

  • Ukraine, Cherkassy
View GitHub Profile
@svetlio
svetlio / no-dbl-click-mat.directive.ts
Last active April 7, 2023 09:48
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'])
$(".sub-menu-mobile > a")['on']("click", function(){
if ($(this).parent().children(".sub-menu-block").css("display") == "none"){
$(".sub-menu-block").css("display","none");
$(this).parent().children(".sub-menu-block").css({"display" : "block"});
return false;
}
})
@codedokode
codedokode / js-task-1.md
Last active July 13, 2024 16:42
Задания на яваскрипт (простые)
@algal
algal / nginx-cors.conf
Created April 29, 2013 10:52
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests