Skip to content

Instantly share code, notes, and snippets.

View benjamincharity's full-sized avatar
🤖

Benjamin Charity benjamincharity

🤖
View GitHub Profile
@benjamincharity
benjamincharity / lowercase.snippet
Created June 28, 2017 18:18
Change the casing of a snippet variable.
# Module
# NOTE: The last line lowercases the first letter of the 1st variable and stores it as the 2nd
# variable
snippet uim "Create a UI module" m
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
/*
*import {
* MdButtonModule,
*} from '@angular/material';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {
MdIconModule,
MdInputModule,
} from '@angular/material';
import { TsSearchComponent } from './search.component';
@benjamincharity
benjamincharity / circleUrl.sh
Created June 12, 2017 11:56
Poll CircleCI build status with CCMenu.
https://circleci.com/cc.xml?circle-token=[circle-token]
@benjamincharity
benjamincharity / copyAndRename.sh
Created June 5, 2017 13:15
Copy and rename a file from the command line (for use in NPM script). Requires https://github.com/mysticatea/cpx
node_modules/.bin/cpx dist/*.css styleguide && for f in styleguide/*.css; do mv \"$f\" \"styleguide/raw-styles.css\"; done
@benjamincharity
benjamincharity / z-index.scss
Last active May 30, 2017 02:14
Determine z-index based off of a list. This allows new items to be added without needing a refactor.
$z-layers: (
"header",
"menu",
"menu-trigger",
);
/////////////////////////////////////////////
//
// Determine the correct z-index
//
@benjamincharity
benjamincharity / sass-lint.yml
Created May 29, 2017 16:40
Sass Lint config file
# sass-lint config
# https://github.com/sasstools/sass-lint/tree/master/docs/rules
files:
include: 'src/**/*.s+(a|c)ss'
ignore:
- 'node_modules/**/*.s+(a|c)ss'
options:
formatter: stylish
rules:
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
@benjamincharity
benjamincharity / colors.scss
Created May 29, 2017 16:37
Manage colors via a method and a map.
// Palettes color map
$palettes: (
mapPrimary: (
xlight: material-color('indigo', '200'), // #9FA8DA
light: material-color('indigo', '500'), // #3F51B5
base: material-color('indigo', '700'), // #303F9F
dark: material-color('indigo', '900') // #1A237E
),
mapAccent: (
light: material-color('cyan', '100'), // #B2EBF2
@benjamincharity
benjamincharity / breakpoints.scss
Last active May 29, 2017 16:49
Manage CSS breakpoints via mixin. Sizes based off of Material's breakpoints.
///////////////////////////
//
// Breakpoints Mixin
//
@mixin bp($point) {
@if $point == 'layout-xs' {
@media (max-width: 599px) { @content; }
}
@benjamincharity
benjamincharity / typography.scss
Last active May 30, 2017 02:12
Manage app typography via a single mixin
$text-styles: (
"site-title",
"site-subtitle",
"title-large",
"title-medium",
"body",
"link-hover",
"small",
);