This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { of } from 'rxjs'; | |
import { propsAreTruthy, tapLog } from 'rxjs-toolkit'; | |
const source$ = of({ | |
foo: { | |
bar: { | |
baz: 'truthy!', | |
}, | |
}, | |
zap: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { from } from 'rxjs'; | |
import { ignoreFalsySignals, tapLog } from 'rxjs-toolkit'; | |
from([ | |
'I', | |
false, | |
'am', | |
null, | |
'truthy', | |
]).pipe( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { someApiService } from './some-api.service'; | |
import { propsAreTruthy, ignoreFalsySignals } from 'rxjs-toolkit'; | |
// imagine getSource$ return an object like this: | |
const exampleSource = { | |
id: '123', | |
origin: { | |
name: '', | |
url: 'noop.com', | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { of } from 'rxjs'; | |
import { tapLog } from 'rxjs-toolkit'; | |
of('hello').pipe( | |
tapLog(), // log out whatever the signal is, so "hello" | |
tapLog('labelFoo') // give it a label, { labelFoo: "hello" } | |
).subscribe() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* tslint:disable:max-classes-per-file */ | |
import {Action} from '@ngrx/store'; | |
import {NavigationExtras} from '@angular/router'; | |
export enum RouterActionTypes { | |
GO = '[router] Go', | |
BACK = '[router] Back', | |
FORWARD = '[router] Forward', | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Breakpoints | |
/// @author Jason Awbrey | |
/// @param { phone | tablet-portrait | tablet-landscape | desktop | desktop-big } $type [no default] | |
/// @return { Number } Rem calculated value for a given breakpoint | |
@function bp($type) { | |
/// @prop | |
$breakpoints: (phone: 599, tablet-portrait: 600, tablet-landscape: 900, desktop: 1200, desktop-big: 1800); | |
@if (map-has-key($breakpoints, $type) != true) { | |
@error "$type must be one of these: #{map-keys($breakpoints)}"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container { | |
word-wrap: break-word; // works for IE11, IE10 | |
overflow-wrap: break-word; // New naming for word-wrap attribute, keep for possible deprecation of word-wrap | |
word-break: break-word; // Helps with non English character wrapping, supported by Blink based browsers | |
.item { | |
// display: block or inline-block may be required | |
max-width: 250px; | |
width: 100%; // Allows for word wrap in IE10/IE11 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/* | |
* Run the Metalsmith build upon hbs and json changes | |
* This enables live reloading of template and data changes | |
*/ | |
const { watch } = require('fs'); | |
const { spawn: run } = require('child_process'); | |
const { resolve, extname } = require('path'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#author @StevenIrby | |
function git-stats() { | |
git log --shortstat --author="$(git config user.name)" | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6; delta+=$4-$6; ratio=deleted/inserted} END {printf "Commit stats:\n- Files changed (total).. %s\n- Lines added (total).... %s\n- Lines deleted (total).. %s\n- Total lines (delta).... %s\n- Add./Del. ratio (1:n).. 1 : %s\n", files, inserted, deleted, delta, ratio }' - | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=breakpoint($size) | |
@if $size == phone-only | |
@media (max-width: 599px) | |
@content | |
@else if $size == tablet-portrait-up | |
@media (min-width: 600px) | |
@content | |
@else if $size == tablet-landscape-up | |
@media (min-width: 900px) | |
@content |