Skip to content

Instantly share code, notes, and snippets.

View dcyoung-dev's full-sized avatar
🥞
Full Stacking

David Young dcyoung-dev

🥞
Full Stacking
View GitHub Profile
@dcyoung-dev
dcyoung-dev / teminal_get_unique_from_paste.sh
Last active June 12, 2019 12:25
Gets the unique vales from clipboard.Use `-c` to add the count
#!/bin/bash
pbpaste | sort | uniq

Switching from bash to zsh

  1. Install zsh using brew brew install zsh
  2. Set ZSH as default shell chsh -s /bin/zsh
  3. Copy bash profile cat ~/.bash_profile >> ~/.zshrc
<h1>Product Records</h1>
<div *ngFor="let record of productRecords | async">
{{record.itemNumber}}
</div>
@dcyoung-dev
dcyoung-dev / ng8-lazy-app-routing.module.ts
Created May 29, 2019 10:59
Angular 8 changes the way in which we lazily load routes from other modules
const routes: Routes = [
{
path: 'old-lazy',
loadChildren: './old-lazy/old-lazy.module#OldLazyModule'
},
{
path: 'new-lazy',
loadChildren: () => import('./new-lazy/new-lazy.module')
.then(m => m.NewLazyModule)
}
@dcyoung-dev
dcyoung-dev / Don't install NPM packages globally
Created April 15, 2019 16:35
Using NPX to install locally rather than globally
`npx -p <package-name> <command>`
eg.
Create new Angular project
`npx -p @angular/cli ng new new-project-name`
Create new NextJS project
`npx -p @nextjs/cli next new new-project-name`
@dcyoung-dev
dcyoung-dev / app.component.html
Created April 14, 2019 21:29 — forked from RajaShanmugamJM/app.component.ts
Simple Google Map Integration with Angular.
<div id="map">
<h4>From map</h4>
</div>
<div id="loc_details">
<h4>Current Location</h4>
<p>
Lat : {{geoLoc.lat }}
</p>
<p>
@mixin for-size($range) {
$phone-upper-boundary: 37.5rem;
$tablet-portrait-upper-boundary: 56.25rem;
$tablet-landscape-upper-boundary: 75rem;
$desktop-upper-boundary: 112.5rem;
@if $range == phone-only {
@media (max-width: #{$phone-upper-boundary - 1}) { @content; }
} @else if $range == tablet-portrait-up {
@media (min-width: $phone-upper-boundary) { @content; }