- Install zsh using brew
brew install zsh
- Set ZSH as default shell
chsh -s /bin/zsh
- Copy bash profile
cat ~/.bash_profile >> ~/.zshrc
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
<div id="map"> | |
<h4>From map</h4> | |
</div> | |
<div id="loc_details"> | |
<h4>Current Location</h4> | |
<p> | |
Lat : {{geoLoc.lat }} | |
</p> | |
<p> |
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
`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` |
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
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) | |
} |
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
<h1>Product Records</h1> | |
<div *ngFor="let record of productRecords | async"> | |
{{record.itemNumber}} | |
</div> |
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
#!/bin/bash | |
pbpaste | sort | uniq |
- Prefer to use
em
/rem
rather thanpx
rem
is the browser's default size - usually equal to16px
em
is relative to it's parent's sizing
- Consider which sizing makes most sense - should the sizing increase if the parent's increases (
em
) or should it remain constant (rem
).
- Always move colours into a separate file and reference through CSS variables
var()
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
# FizzBuzz | |
def add_trigger_word(number, factor, output_array, word) | |
output_array << word if number % factor == 0 | |
output_array | |
end | |
word_map = { | |
3 => "Fizz", | |
5 => "Buzz", |
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
<script> | |
// Declaring a new jQuery function | |
(function ($) { | |
$.fn.newSuperCoolFunction = function () { | |
return this.each(function (_, selector) { | |
var elements = $(selector) | |
elements.each(function (_, elementSelector) { | |
var element = $(elementSelector); | |
element.addClass('super-cool') |
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
# Stop Google's FLoc https://andycroll.com/ruby/opt-out-of-google-floc-tracking-on-netlify | |
[[headers]] | |
for = "/*" | |
[headers.values] | |
Permissions-Policy = "interest-cohort=()" |
OlderNewer