Skip to content

Instantly share code, notes, and snippets.

View zakmac's full-sized avatar

Zak MacDonald zakmac

View GitHub Profile
@zakmac
zakmac / _angular-material-toolbar-density.generator.scss
Created December 9, 2020 19:50
Angular Material Toolbar Density Generator Mixin -- Based on Official Material Styles
@import '~@angular/material/theming';
@mixin toolbar-density($density-config, $density-scale: default) {
$height-desktop: _mat-density-prop-value(
$density-config,
$density-scale,
height
);
@zakmac
zakmac / _angular-material-table-density.generator.scss
Created December 9, 2020 19:46
Angular Material Table Density Generator Mixin -- Based on Official Material Styles
@import '~@angular/material/theming';
@mixin table-density($density-config, $density-scale: default) {
$row-height: _mat-density-prop-value(
$density-config,
$density-scale,
height,
);
@zakmac
zakmac / _angular-material-list-density.generator.scss
Last active December 9, 2020 19:47
Angular Material List Density Generator Mixin -- Based on Official Material Styles
@import '~@angular/material/theming';
@import '~@angular/material/divider/divider-offset';
@import '~@angular/material/list/list-theme';
@import './angular-material-list-density.variables';
@function _list-density-values(
$density-config,
@zakmac
zakmac / Gulpfile.js
Created August 6, 2019 06:24 — forked from webdesserts/Gulpfile.js
Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/gulp).
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise.
var gulp = require('gulp'),
spawn = require('child_process').spawn,
node;
/**
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
@zakmac
zakmac / kendo-grid-highlight-locked-rows.js
Created March 3, 2018 00:48
Enable full row highlight on Kendo grids with locked columns
// About: By default, a Kendo grid with locked column(s) will only highlight a row on hover in either the scrollable
// columns, or locked columns; not both. Placing this binding in the $kGrid.dataBound() event will enable
// highlighting the entire row at once.
// Author: Zak MacDonald <http://github.com/zakmac>
// JSBin: http://jsbin.com/qenehifoli/edit?js,output
// Note: Since dataBound can be invoked multiple times, we unbind with $.off() before binding with $.on(), for better
// or worse; You may also want to unbind in the $kGrid.remove() event.
$('#my-k-grid').off('mouseenter mouseleave').on('mouseenter mouseleave', 'tr', function(event) {
@zakmac
zakmac / kendo-to-fontawesome.scss
Last active May 26, 2017 07:01
Replace Kendo UI icons with FontAwesome icons
/*
* kendo icon overrides
* NOTE: the purpose of this is to remap kendo ui icons in the interface to their fontawesome counterpart
* TODO: icon sprites replaced by icon font in newer kendo releases (v4.7+)
* * * * * * * * * * * * * * * * */
// NOTE: list syntax - kendo icon | fa icon | fa icon code
$icons:
k-i-arrow-e fa-caret-right \f0da,
k-i-arrow-n fa-caret-up \f0d8,
@zakmac
zakmac / components.masked-input.js
Last active October 17, 2016 16:39
mask input in ember
import Ember from 'ember';
export default Ember.Component.extend({
maskedInput: Ember.computed('unmaskedInput', function() {
let input = Ember.get(this, 'unmaskedInput');
let rx = /[\w]/gi;
return input.replace(rx, function(match, tag, char) {
console.log('*', match, tag, char);
if (tag !== undefined) {
@zakmac
zakmac / components.deep-link.js
Last active October 6, 2016 21:32
Dashboard Nav Test
import Ember from 'ember';
// GitHub - https://github.com/zakmac/ember-cli-filter-component
// npm - npmjs.com/package/ember-cli-filter-component
/**
* FilterContentComponent
*
* @description component that applys a simple filter to a specified content model
* based on basic matching
@zakmac
zakmac / .scss-lint.yml
Last active August 29, 2015 14:25
SCSS linter settings
# https://github.com/brigade/scss-lint/blob/master/lib/scss_lint/linter/README.md
# file includes
scss_files: 'app/styles/**/*.scss'
# linter settings
linters:
BangFormat:
space_before_bang: true
space_after_bang: false