Skip to content

Instantly share code, notes, and snippets.

View chrillewoodz's full-sized avatar

Christoffer Skogh chrillewoodz

View GitHub Profile
import {DebugElement, NO_ERRORS_SCHEMA} from '@angular/core';
import {Location} from '@angular/common';
import {Router} from '@angular/router';
import {By} from '@angular/platform-browser';
import {RouterTestingModule} from '@angular/router/testing';
import {
async,
ComponentFixture,
TestBed
import {Injectable} from '@angular/core';
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
@Injectable()
export class ModalApi {
private states = new BehaviorSubject<any>(true);
public states$ = this.states.asObservable();
import {
ChangeDetectionStrategy,
Component,
forwardRef,
Input
} from '@angular/core';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
// Custom
module.exports = function(grunt) {
// Load all tasks
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
var mozjpeg = require('imagemin-mozjpeg');
var htmlFileList = [
'index.html'
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
@chrillewoodz
chrillewoodz / masonry-grid.scss
Last active August 29, 2015 14:27
Masonry grid system
$breakpoints: (xs, sm, md, lg);
$calculation: '';
@each $breakpoint in $breakpoints {
@for $i from 1 through 12 {
$calculation: 0% + ($i * 100 / 12);
.masonry-#{$breakpoint}-#{$i} {
// JS
(function(caption) {
var stepX, stepY,
//screen grid width and height
width, height,
doc,
//message to show
message, messageLength, currentChar, getChar,
messageLeft, messageRight, messageTop,