Angular + PowerShell | Cookbook
Create component for all folders in a directory
Get-ChildItem ..\samples\src | foreach { ng generate component app/pages/$_.name }
Tipps und Tricks für Entwickler und IT-Interessierte
Get-ChildItem ..\samples\src | foreach { ng generate component app/pages/$_.name }
ng new app
cd app
npm install jspdf --save npm install types/jspdf --save
ng generate component pages/PDF
src/app/app-routing.modules.ts
import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { PDFComponent } from './pages/pdf/component'; const routes: Routes = [ { path: '', redirectTo: 'pdf', pathMatch: 'full', }, { path: 'pdf', component: PDFComponent, }, ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule], }) export class AppRoutingModule {}
src/app/pages/pdf/pdf.component.html
src/app/pages/pdf/pdf.component.ts
Add import for jsPDF
import { jsPDF } from 'jspdf';
pip install ansible
In this example, we use Vagrant. But using docker is also a good choice
Change IP Address and Hostname for each virtual machine
Vagrant.configure("2") do |config| config.vm.box = "hashicorp/bionic64" config.vm.network "public_network", ip: "172.16.2.191", bridge: "en0: Ethernet" config.vm.synced_folder "./data", "/DATA" config.vm.hostname = "host1" end
vagrant up vagrant ssh
Install required programm sshpass for running ansible commands as root on target machines.
sudo apt-get install sshpass
ssh-keygen -t rsa
id_rsa_<user>.pub
to virtual machines into $HOME/.ssh
/authorized_keysansible1 ansible2 ansible3
Create Ansible configuration file in current directory with this content:
[defaults] interpreter_python = auto
Ansible searches for configuration files in the following order, processing the first file it finds and ignoring the rest:
$ANSIBLE_CONFIG
if the environment variable is set.ansible.cfg
if it’s in the current directory.~/.ansible.cfg
if it’s in the user’s home directory./etc/ansible/ansible.cfg
, the default config file.ansible -i etc/ansible/hosts all -m ping -u vagrant
Set default Python version on Ubuntu
update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1
Create file httpd.yaml
--- - hosts: webservers remote_user: ansible tasks: - name: Ensure apache is installed and updated yum: name: httpd state: latest become: yes
ansible-playbook -i etc/ansible/hosts httpd.yaml -kK
$ sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
npm install -g @ionic/cli
ionic start Getting-Started tabs --type react
ionic serve
npm init stencil npm install --save-exact @stencil/core@latest npm install --save-dev @types/jest@26.0.12 jest@26.4.2 jest-cli@26.4.2 npm install --save-dev @types/puppeteer@3.0.1 puppeteer@5.2.1 npm test npm start
VideoJS | HTML5 player framework | Video | Home | Github | |
Animate on Scroll | Animation | Home | michalsnik/aos | ||
ScrollMagic | Animation | Home | |||
ScrollRevealJS | Animation | Home/ | jlmakes/scrollreveal | ||
PixiJS | Graphics | Home | pixijs/pixi.jsthub | ||
Anime | Animation | Home | juliangarnier/anime | ||
ThreeJS | Graphics | Home | mrdoob/three.js | ||
animate.css | Animation | Home | animate-css/animate.css | ||
HowlerJS | Audio library | Audio | Home | Github | |
RevealJS | HTML Presentation Framework | Presentation | Home | Github | |
ChartJS | Chart | Home | Github | ||
anime.js | Home | ||||
granim.js | Create fluid and interactive gradient animations | Graphics | Home | sarcadass/granim.js | |
Multiple.js | Sharing background across multiple elements using CSS | Home | NeXTs/Multiple.js | ||
choreographer-js | A simple library to take care of complicated animations. | Home | christinecha/choreographer-js | ||
cleave.js | Format your <input/> content when you are typing | Home | nosir/cleave.js | ||
premonish | Home | mathisonian/premonish | |||
Splitting | Animation | Home | Codepen | shshaw/splitting/ | |
To import multiple files from a folder, the following two steps had to be done:
When importing files with Power BI, you can do both tasks together or each task separately.
The decision, which way to go, ist done after selection the folder:
You could choose between 4 posibilities. Strictly speaking, you have to possibilities, both with the same to final steps.
In order to better understand the process, we show the two steps separately: one after the other
Start Power BI and close the start screen, if it is still visible.
Then, click on the Get Data Button in the Home Ribbon
If you click on the small down arrow on the Get Data Button, you have to select the option More
Now, select Folder and click on Connect
Enter the folder (or Browse…) with the files to be loaded and click Ok
After this, Power Query will create a table with all files in the folder.
Now, here is the point to decide, which way to go:
We will choose to load the files, because we will do each step later separately
In Power BI Desktop, click on the Data Icon to show the resulting table.
To add additional steps, we need the Power Query Editor.
So click on the 3 dots at the right side of the Query name Samples and choose Edit Query
Now, you are in the Power Query Editor
To combine all files, just click on the small icon beneath the header of the content column:
In the following dialog, you will see all files an a preview of the content for each file. For excel files, you will see the sheet names and the names of the intelligent tables in the sheets.
Click on OK to start the import.
When Power Query is done with this step, you will see the result:
The previous query Samples is still there, but now with the content of all files.
Additionally, you will see four other elements:
Each query consists of a list of steps, which are process one after another. Normaly, each step is using the result (data) of the previous step, performs some modifications and has a result (data) for the next step.
So, each step is modifying the whole data of the previous step. Describing some modifications means either
or
Lets see, how Power Query solves this task.
In the query Samples, exampine the Step Invoke Custom Function1
The Step if performing the M function Table.AddColumn
This functions needs 3 parameter:
This results in the following procedure:
This is the required function to create the column content for each file
For the resulting query Samples to work, only the function definition is required.
But Power Query add some additional elements, to test the function and show the result
Create a parameter used in the query Transform Sample File and define the curent value Sample File
Define a value for the parameter. Here, the first row in the list of files is used.
Create a query and use an excel workbook as input. The name of the excel file is speficied as a parameter
In this query, the previously create parameter Parameter1 is used as parameter (to much of the word parameter, i know :))
If the selected folder contains files with different format, the result is not what you may be expect:
The list of files contains all files, both csv files and xls files
When combining the files, you can select between the files. So first take a look at an csv file:
The csv file looks as expected:
But the xls files looks strange:
But lets try. Click on ok to combine all files.
But, looking at the resulting query, the data of the xls files still looks strange:
To understand this, take a look into the create transfer function:
The crucial instruction is line 2:
Source = Csv.Document(Parameter3,[Delimiter=",", Columns=10, Encoding=1252, QuoteStyle=QuoteStyle.None]),
The source document (each file in the list of files) is interpreted as csv file.
So, the xls files are also read in as csv files. This leads to the strange result.
You can fix this by adding an additional filter step in the query to select only csv files: