(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // Iterative | |
| const size = (tree) => { | |
| const axe = [tree]; | |
| let total = 0; | |
| if(!tree){ | |
| return n; | |
| } | |
| while(axe.length) { |
| const rightMost = tree => { | |
| if(!tree.right){ | |
| return tree; | |
| } | |
| return rightMost(tree.right); | |
| } | |
| const deleteRmt = tree => { | |
| if(!tree){ | |
| return; |
| const insert = (tree, value) => { | |
| const plug = []; | |
| plug.push(tree); | |
| while(plug.length){ | |
| const elem = plug.shift(); | |
| if(!elem.left) { | |
| elem.left = node(value); | |
| break; |
| const node = val => { | |
| return { | |
| data: val, | |
| left: null, | |
| right: null | |
| }; | |
| } | |
| const buildTree = () => { | |
| const root = node(10); |
| /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | |
| /* Latitude/longitude spherical geodesy tools (c) Chris Veness 2002-2019 */ | |
| /* MIT Licence */ | |
| /* www.movable-type.co.uk/scripts/latlong.html */ | |
| /* www.movable-type.co.uk/scripts/geodesy-library.html#latlon-spherical */ | |
| /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | |
| import Dms from './dms.js'; | |
| const π = Math.PI; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import { Directive, Input, HostBinding } from '@angular/core'; | |
| @Directive({ | |
| selector: 'img[appImageFallback]' | |
| }) | |
| export class ImageFallbackDirective { | |
| fallback = 'path/to/default/image.png'; | |
| @Input() src: string; |
git checkout --orphan future-master
git add -A # Add all files and commit them
git commit
git branch -D master # Deletes the master branch
git branch -m master # Rename the current branch to master
git push -f origin master # Force push master branch to github
git gc --aggressive --prune=all # remove the old files
| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| //CSS | |
| ## Installs for a new Mac | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| brew cask install google-chrome appcleaner hyper docker visual-studio-code keka google-backup-and-sync dropbox adware-removal-tool | |
| brew cask install skype | |
| brew install fish node python | |
| ## setup fish as default | |
| sudo cat /usr/local/bin/fish >> /etc/shell |