Skip to content

Instantly share code, notes, and snippets.

View cyberdante's full-sized avatar
😎
In Tampa, FL. Coding from home.

Damian Perez cyberdante

😎
In Tampa, FL. Coding from home.
View GitHub Profile
@cyberdante
cyberdante / BEM__grid.scss
Created December 21, 2018 06:36
Simple BEM grid system
$grid__bp-sm: 576;
$grid__bp-md: 768;
$grid__bp-lg: 992;
$grid__bp-xl: 1200;
$grid__cols: 12;
$map-grid-props: (
'': 0,
'-sm': $grid__bp-sm,
'-md': $grid__bp-md,
@cyberdante
cyberdante / ngDisableDirective
Created September 20, 2017 14:54
Angular 4 directive for disabling other DOM elements that don't have a native disabled attribute without using pointer-events: none (to support IE <11)
import { Directive, ElementRef, Input, Renderer } from '@angular/core';
import { NgControl, FormControl } from '@angular/forms';
@Directive({
selector: '[ng-disable]'
})
export class NgDisableDirective {
@Input('ng-disable') public isDisabled: boolean = false;
private control: FormControl = new FormControl('');
private wrapper;
@cyberdante
cyberdante / focusDirective.js
Last active September 20, 2017 14:56
Angular 1.x directive to focus on an input
(function (angular) {
"use strict";
focusElemDirective.$inject = ['$timeout', '$parse'];
function focusElemDirective($timeout, $parse) {
return {
link: function (scope, element, attrs) {
var input = $parse(attrs.focusElem);