Skip to content

Instantly share code, notes, and snippets.

[user]
name = comeonandroid
email = [email protected]
[color]
ui = auto
[alias]
st = status
ci = commit --verbose
co = checkout
di = diff
@ilyaviache
ilyaviache / tree.pipe.ts
Last active February 19, 2017 11:48
Transform flat array into tree view. Wrapped in Angular2 pipe
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'tree' })
export class TreePipe implements PipeTransform {
transform(arr, args?: any[]) {
return this.buildTree(arr)
}
buildTree(elements, tree = []) {
elements.forEach((element) => {
@ilyaviache
ilyaviache / cd-nav-trigger
Created October 2, 2015 19:45
simple menu trigger icon
.cd-nav-trigger {
/* navigation trigger - visible on mobile devices only */
float: right;
position: relative;
display: block;
width: 34px;
height: 44px;
margin-right: 5%;
/* hide text */
overflow: hidden;