Skip to content

Instantly share code, notes, and snippets.

View oleersoy's full-sized avatar

Ole Ersoy oleersoy

  • Firefly Semantics Corporation
  • Chicago
View GitHub Profile
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { ToolbarComponent } from './toolbar.component';
import { MaterialModule } from './material.module';
@NgModule({
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { ToolbarComponent } from './toolbar.component';
import { MaterialModule } from './material.module';
@NgModule({
import { Component, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
@Component({
selector: 'my-login-form',
template: `
<mat-card>
<mat-card-title>Login</mat-card-title>
<mat-card-content>
<form [formGroup]="form" (ngSubmit)="submit()">
import { Pipe, PipeTransform } from '@angular/core';
/**
* Turns the array into a sentence.
*
* @example
* {{ ['Stephen', 'Trevor' ] | AddCommas:'Customer' }}
*/
@Pipe({ name: 'AddCommas' })
export class AddCommasPipe implements PipeTransform {
import { Pipe, PipeTransform } from '@angular/core';
/**
* Strips any html characters
* from the `target`, abbreviates the resulting string
* to the max length, and appends an ellipsis character
* to the result.
*
* @example
* {{ title | ellipsis:200 }}
*/
@oleersoy
oleersoy / index.js
Last active January 15, 2019 18:24
postcss uncss
const postcss = require('postcss')
const fs = require('fs')
const options = {
html: ['html/*.html']
}
fs.readFile('css/index.css','utf8', (err, css) => {
postcss([require('postcss-uncss')(options)])
.process(css, { from: 'css/app.css', to: 'css/filtered.css' })
@oleersoy
oleersoy / index.js
Created January 25, 2019 19:54
Sugarss example
const autoprefixer = require('autoprefixer');
var sugarss = require('sugarss');
var postcss = require('postcss');
var fs = require('fs');
fs.readFile('red.sss', 'utf-8', (err, css)=>{
postcss([autoprefixer])
.process(css, { parser: sugarss, from: './red.sss', to: './app.css' })
.then(result => {
fs.writeFile('./app.css', result.css, () => true)
@oleersoy
oleersoy / fixture.js
Created January 26, 2019 02:45
fixtures for file system reads
"use strict";
const html = ()=>{
return
`<!DOCTYPE html>
<html lang="en">
`}
const css = ()=>{
return `.red { color: red; }`
}
@oleersoy
oleersoy / gherkin.html
Created February 13, 2019 21:01
Gherkin Test file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Gherkin Component</title>
<link href="../css/index.css" rel="stylesheet">
</head>
let list = "none, inherit, circle, disc, decimal, lower-alpha, lower-latin, lower-greek, lower-roman, upper-alpha, upper-latin, upper-greek, upper-roman";
let a = list.split(',').map(s=>s.trim());
console.log(a);