Skip to content

Instantly share code, notes, and snippets.

View berardo's full-sized avatar

Jose Berardo berardo

View GitHub Profile
@Component({
selector: 'my-component',
templateUrl: './my-component.html',
styleUrls: ['./my-component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MyComponent {}
@berardo
berardo / angular-nativescript-course-setup-windows10.bat
Last active July 8, 2020 13:31
Script to install all good tools on a fresh new Windows 10 machine. The main reason for this file is to be used on my online course: https://udemy.com/angular-native Raw
:: I think it's didactic showing the actions done here in the window
:: @echo off
:: This line should be executed before you run the current script
:: Don't follow along before doing that
:: @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
:: Git
choco install git.install -y
:: Restart your command prompt
@berardo
berardo / angular-nativescript-course-setup-ubuntu2.sh
Last active July 8, 2020 13:31
2nd script to install all good tools on a fresh new Linux machine. The main reason for this file is to be used on my online course: https://udemy.com/angular-native. Be sure you have everything in the 1st script: https://gist.github.com/berardo/80aa074fa870990744bb1ef8829cc0cf
# Java
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install java-common oracle-java8-installer
# sudo update-alternatives --config java
sudo apt-get install oracle-java8-set-default
echo "export JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')" >> ~/.zshrc
source ~/.zshrc
@berardo
berardo / angular-nativescript-course-setup-ubuntu1.sh
Last active July 8, 2020 13:28
1st script to install all good tools on a fresh new Linux machine. The main reason for this file is to be used on my online course: https://udemy.com/angular-native. After that you might want to continue installing this: https://gist.github.com/berardo/165d6047948125dba7cbcd2eaefcfe6e
#!/bin/sh
# sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 libstdc++6:i386
sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0:i386 libstdc++6:i386
# G++
sudo apt-get install g++
# zsh
sudo apt-get install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
@berardo
berardo / kernel_extensions.sh
Created October 26, 2017 06:52
Script to load kernel extensions in order to allow `brew cask reinstall --force virtualbox`
#!/bin/bash
unload() {
if [ `ps -ef | grep -c VirtualBox$` -ne 0 ]
then
echo "VirtualBox still seems to be running. Please investigate!!"
exit 1;
elif [ `ps -ef | grep -c [V]ir` -gt 0 ]
then
echo "Stopping running processes before unloading Kernel Extensions"
@berardo
berardo / ES6modules-resumo_geral.md
Last active February 22, 2022 09:43
Resumo geral sobre ES6 Modules - Material complementar dos meus cursos sobre Javascript no Udemy.com (https://www.udemy.com/user/joseberardo/)

ES6 MODULES - RESUMO GERAL

Instruções imports são úteis para linkar módulos (arquivos). Bundlers (ex: Browserify / Webpack) são normalmente acionados para criar um arquivo contendo tudo que foi importado a partir de um arquivo entry point e a ramificação de suas dependências. Loaders são capazes de carregar módulos dinamicamente (ex: O SystemJS é capaz de carregar módulos exportados em qualquer formato: CommonJS, AMD, ES6, variáveis globais e até mesmo módulos paraguaios vindos pela Ponte da Amizade ;)

Obs: Há um projeto chamado SystemJS builder que é um bundler e talvez possamos considerar o Webpack Dev Server um loader que roda dentro um serviço HTTP próprio. Ambos também suportam módulos não ES6.

Apesar se ser possível carregar módulos dinamicamente, a especificação ES6 modules determina que elas são instruções declarativas, sendo obrigatoriamente realizadas antes do script iniciar. [Isso traz diversas vantagens]

@berardo
berardo / angular-nativescript-course-setup.sh
Last active June 25, 2022 12:28
Script to install all good tools on a fresh new macOS machine. Some command are commented out because the main reason for this file is to be used on my online course: https://udemy.com/angular-native
#!/bin/sh
# Allow locate commands
# sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
# xcode command line - Select: "Get xcode" and go get a coffee (preferably far from your desk :)
xcode-select --install
# home-brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"