Lawrence  Lesch

Lawrence Lesch


Secure Boilerplate for Electron App Based on Vite

Vite Electron Builder Boilerplate

This is a template for secure electron applications. Written following the latest safety requirements, recommendations and best practices.

Under the hood is Vite — A next-generation blazing fast bundler, and electron-builder for packaging.

Get started

Follow these steps to get started with the template:

  1. Click the Use this template button (you must be logged in) or just clone this repo.
  2. If you want to use another package manager don't forget to edit .github/workflowsit uses npm by default.

That's all you need. 😉

Note: This template uses npm v7 feature — Installing Peer Dependencies Automatically. If you are using a different package manager, you may need to install some peerDependencies manually.


Electron Electron version

  • This template uses the latest electron version with all the latest security patches.
  • The architecture of the application is built according to the security guides and best practices.
  • The latest version of the electron-builder is used to package the application.

Vite Vite version

  • Vite is used to bundle all source codes. It's an extremely fast bundler, that has a vast array of amazing features. You can learn more about how it is arranged in this video.
  • Vite supports reading .env files. You can also specify the types of your environment variables in types/env.d.ts.
  • Automatic hot-reloads for the Main and Renderer processes.

Vite provides many useful features, such as: TypeScript, TSX/JSX, CSS/JSON Importing, CSS Modules , Web Assembly and much more.

See all Vite features.

TypeScript TypeScript version (optional)

  • The latest version of TypeScript is used for all the source code.
  • Vite supports TypeScript out of the box. However, it does not support type checking.
  • Code formatting rules follow the latest TypeScript recommendations and best practices thanks to @typescript-eslint/eslint-plugin.

Guide to disable typescript and remove dependencies

Vue Vue version (optional)

  • By default, web pages are built using Vue. However, you can easily change that. Or not use additional frameworks at all.
  • Code formatting rules follow the latest Vue recommendations and best practices thanks to eslint-plugin-vue.

Find more forks 🔱 for others frameworks or setups

Continuous Integration

  • The configured workflow will check the types for each push and PR.
  • The configured workflow will check the code style for each push and PR.
  • Automatic tests used Vitest Vitest version -- A blazing fast test framework powered by Vite.
    • Unit tests are placed within each package and are ran separately.
    • End-to-end tests are placed in the root tests directory and use playwright.

Workflow graph


  • Each time you push changes to the main branch, the release workflow starts, which creates a new draft release. For each next commit will be created and replaced artifacts. That way you will always have draft with latest artifacts, and the release can be published once it is ready.
    • Code signing supported. See release workflow.
    • Auto-update is supported. After the release is published, all client applications will download the new version and install updates silently.

Note: This template configured only for GitHub public repository, but electron-builder also supports other update distribution servers. Find more in electron-builder docs.

How it works

The template requires a minimum amount dependencies. Only Vite is used for building, nothing more.

Project Structure

The structure of this template is very similar to a monorepo. The entire source code of the project is divided into three modules (packages) that are each bundled independently:

  • packages/renderer. Responsible for the contents of the application window. In fact, it is a regular web application. In developer mode, you can even open it in a browser. The development and build process is the same as for classic web applications. Access to low-level API electrons or Node.js is done through the preload layer.
  • packages/preload. Contain Electron preload scripts. Acts as an intermediate bridge between the renderer process and the API exposed by electron and Node.js. Runs in an isolated browser context, but has direct access to the full Node.js functionality.
  • packages/main Contain Electron main script. This is the main process that powers the application. It manages creating and handling the spawned BrowserWindow, setting and enforcing secure permissions and request handlers. You can also configure it to do much more as per your need, such as: logging, reporting statistics and health status among others.

Schematically, the structure of the application and the method of communication between packages can be depicted as follows:

flowchart TB;

packages/preload <-. IPC Messages .-> packages/main

    subgraph packages/main["packages/main (Shared beatween all windows)"]
    M[index.ts] --> EM[Electron Main Process Modules]
    M --> N2[Node.js API]

subgraph Window["Browser Window"]
    subgraph packages/preload["packages/preload (Works in isolated context)"]
    P[index.ts] --> N[Node.js API]
    P --> ED[External dependencies]
    P --> ER[Electron Renderer Process Modules]

    subgraph packages/renderer
    R[index.html] --> W[Web API]
    R --> BD[Bundled dependencies]
    R --> F[Web Frameforks]

packages/renderer -- Call Exposed API --> P

Build web resources

The main and preload packages are built in library mode as it is simple javascript. The renderer package builds as a regular web app.

Compile App

The next step is to package a ready to distribute Electron app for macOS, Windows and Linux with "auto update" support out of the box.

To do this, use electron-builder:

  • Using the npm script compile: This script is configured to compile the application as quickly as possible. It is not ready for distribution, it is compiled only for the current platform and is used for debugging.
  • Using GitHub Actions: The application is compiled for any platform and ready-to-distribute files are automatically added as a draft to the GitHub releases page.

Working with dependencies

Because the renderer works and builds like a regular web application, you can only use dependencies that support the browser or compile to a browser-friendly format.

This means that in the renderer you are free to use any frontend dependencies such as Vue, React, lodash, axios and so on. However, you CANNOT use any native Node.js APIs, such as, systeminformation. These APIs are only available in a Node.js runtime environment and will cause your application to crash if used in the renderer layer. Instead, if you need access to Node.js runtime APIs in your frontend, export a function form the preload package.

All dependencies that require Node.js api can be used in the preload script.

Expose in main world

Here is an example. Let's say you need to read some data from the file system or database in the renderer.

In the preload context, create a function that reads and returns data. To make the function announced in the preload available in the render, you usually need to call the electron.contextBridge.exposeInMainWorld. However, this template uses the unplugin-auto-expose plugin, so you just need to export the method from the preload. The exposeInMainWorld will be called automatically.

// preload/index.ts
import { readFile } from 'node:fs/promises';

// Encapsulate types if you use typescript
interface UserData {
  prop: string

// Encapsulate all node.js api
// Everything you exported from preload/index.ts may be called in renderer
export function getUserData(): Promise<UserData> {
  return readFile('/path/to/file/in/user/filesystem.json', {encoding:'utf8'}).then(JSON.parse);

Now you can import and call the method in renderer

// renderer/anywere/component.ts
import { getUserData } from '#preload'
const userData = await getUserData()

Find more in Context Isolation tutorial.

Working with Electron API

Although the preload has access to all of Node.js's API, it still runs in the BrowserWindow context, so a limited electron modules are available in it. Check the electron docs for full list of available methods.

All other electron methods can be invoked in the main.

As a result, the architecture of interaction between all modules is as follows:

renderer->>+preload: Read data from file system
preload->>-renderer: Data
renderer->>preload: Maximize window
activate preload
preload-->>main: Invoke IPC command
activate main
main-->>preload: IPC response
deactivate main
preload->>renderer: Window maximized
deactivate preload

Find more in Inter-Process Communication tutorial.

Modes and Environment Variables

All environment variables are set as part of the import.meta, so you can access them vie the following way: import.meta.env.

Note: If you are using TypeScript and want to get code completion you must add all the environment variables to the ImportMetaEnv in types/env.d.ts.

The mode option is used to specify the value of import.meta.env.MODE and the corresponding environment variables files that need to be loaded.

By default, there are two modes:

  • production is used by default
  • development is used by npm run watch script

When running the build script, the environment variables are loaded from the following files in your project root:

.env                # loaded in all cases
.env.local          # loaded in all cases, ignored by git
.env.[mode]         # only loaded in specified env mode
.env.[mode].local   # only loaded in specified env mode, ignored by git

Warning: To prevent accidentally leaking env variables to the client, only variables prefixed with VITE_ are exposed to your Vite-processed code.

For example let's take the following .env file:


Only VITE_SOME_KEY will be exposed as import.meta.env.VITE_SOME_KEY to your client source code, but DB_PASSWORD will not.

You can change that prefix or add another. See envPrefix


See Contributing Guide.

Download Details:

Author: Cawa-93
Source Code: 
License: MIT license

#typescript #electron #react #template #boilerplate 

Secure Boilerplate for Electron App Based on Vite
Nat  Grady

Nat Grady


Create Resources using an ARM Template Locally


ARM template is used to create resources as per the Azure Resource Manager. The template file is written in JSON. And we can deploy it using the azure portal or locally using Azure CLI or Azure PowerShell. Here, in this blog, we will deploy the template using the local method.


  1. Understanding of Azure Services
  2. Linux OS
  3. Visual Studio Code ( optional )

Preparations for the ARM template

1. VS Code Extension

If you have visual studio code installed on your system locally, you can install the following extension for the ARM template: Azure Resource Manager (ARM) tools. This provides snippets and auto-completion for ARM templates.

2. Azure CLI setup

We need to install Azure CLI on our local system. And so, we follow the steps defined here. These are steps for Ubuntu but you may change them as per your Operating System.

Then do login on to your Azure account using Azure CLI

az login browser

az login cli

Now configure default values to make it easy for deployment, like location and resource group.

az default value

Creating the ARM template

  1. Create an azuredeploy.json file.
  2. Open in Visual studio code.
  3. Type arm and select the first option. The ARM tools extension creates a basic snippet.
  4. Similarly, click inside resources and type storage and select the first option. We now have the storage account snippet.
  5. As you can see inside the snippet, the location is already parameterized.
  6. We will parameterize the name and storage type option.
    • We add parameters inside parameters. Click inside the square brackets and type par and press “ENTER
    • After that, we modify the snippets as shown in the diagram.
  7. And then we modify the resource values to take the input per the parameters defined.
  8. If we want, we can add output to define what to print after the successful deployment.

arm snippet

arm template snippet

Adding parameters

Arm template parameters

parameters snippet

Modify them as per use.

parameter defined

Modify values in resources.

parameters input

Define the outputs.

output ARM template

Running the ARM Template

We run the following set of commands.

running template

And when it says running on Azure CLI, we move to the azure portal to see if it is deploying: Home —> Resource groups —> Resource Group selected —> deployments

template status portal

Once the deployment completes, it shows completed. Click on the deployment name and go to the resource.

deployed resource

resource created

Similarly, the Azure CLI gives output.

deployment outputConclusion

The ARM template is similar to AWS cloud formation and other IaC automation available. This was for learning you can modify and play with source code from Knoldus TechHub. Keep Learning!

Original article source at:

#azure #arm #template #local 

Create Resources using an ARM Template Locally
Rupert  Beatty

Rupert Beatty


How to Reusable Component Pieces with ngTemplate Outlet


ng-template, ng-container, and ngTemplateOutlet provide the ability to reuse content inside an Angular component. Understanding what’s going on and how to use these methods allows a developer to build what they want without needing to duplicate parts of the template.

Explanation of the Problem

Have you ever needed to use *ngIf in your template, and if the expression evaluates to false use a backup template? On top of that, maybe both situations (if the expression is true or false) require the same layout inside of the element that has the *ngIf directive on it.

I recently had came across this situation. We had some data that was being output in a list either had a link that stayed internal to the app or opened a link in a new tab external to the application. The content inside the links, however, always had the same layout. I didn’t want to duplicate the inner content, and luckily Angular provides the ability to accomplish this. The method includes using ng-template, ng-container, and ngTemplateOutlet.

Before getting to the end solution, let’s look at an example of the data and how it’s output without using ng-template.

export class ListComponent {
  links = [
    { internal: true, display: "Home", url: "/" },
    { internal: false, display: "External", url: "" },
  <li *ngFor="let link of links">
    <a *ngIf="link.internal" [routerLink]="link.url">
      <img src="/assets/icon.svg" alt="">
      <span>{{ link.display }}</span>
    <a *ngIf="!link.internal" [attr.href]="link.url">
      <img src="/assets/icon.svg" alt="">
      <span>{{ link.display }}</span>

In this method, we have two *ngIf directives on two separate a tags, and the inner content of the link is the same in both cases. If that inner content changes, we have to make the change to both places or else there are inconsistencies in the layout. This is not ideal; we are repeating ourselves and there are multiple locations where we can introduce bugs.


Angular provides a much more elegant solution to our problem. Our TypeScript code from above will remain the same, but we can have a lot less duplication in the HTML by using a couple special Angular tags. First I’ll show the HTML, and then we’ll discuss the different pieces.

  <li *ngFor="let link of links">
    <a *ngIf="link.internal; else externalLink" [routerLink]="link.url">
        [ngTemplateOutletContext]="{ link: link }"
    <ng-template #externalLink>
      <a [attr.href]="link.url">
          [ngTemplateOutletContext]="{ link: link }"

<ng-template #linkLayout let-link="link">
  <img src="/assets/icon.svg" alt="" />
  <span>{{ link.display }}</span>

There’s a lot going on here, so let’s break it down. We’ll start with the *ngIf on the a tag.

<a *ngIf="link.internal; else externalLink" [routerLink]="link.url">
    [ngTemplateOutletContext]="{ link: link }"
<ng-template #externalLink>
  <a [attr.href]="link.url">
      [ngTemplateOutletContext]="{ link: link }"

The *ngIf directive has an expression listed: if link.internal evaluates to true, then show this a tag. If it’s false, output the ng-template tag that’s referenced by the externalLink local template variable. This is how we can either navigate to a new route that’s part of the Angular app or external to the app. This is a method that can be used in any situation where your *ngIf needs an else clause.

Next up, let’s look at what’s going on with the ng-container inside both of the a tags in the example.

  [ngTemplateOutletContext]="{ link: link }"

You can read more about the ng-container element in the Angular docs, but at a high level it’s a special element that can hold structural directives without adding new elements to the DOM. It can also be used in situations like this, with the ngTemplateOutlet structural directive. The ngTemplateOutlet directive determines what ng-template will be output on the page inside the ng-container. The context for the template, or needed variables, can be declared with the ngTemplateOutletContext directive. In the above case, we are saying that the #linkLayout content should be output on the page, and that there should be a variable called link that will be used inside the ng-template. The contents of the ng-template tag can be placed anywhere in the HTML file, though I’ve placed them at the bottom in this example.

<ng-template #linkLayout let-link="link">
  <img src="/assets/icon.svg" alt="" />
  <span>{{ link.display }}</span>

This template will be output on the screen anywhere it’s referenced. In this case, inside both a tags. If we want to change the layout inside the a tags, we need only change this one spot in the HTML. Everything will be kept in sync, and we have fewer possibilities of inconsistencies in the component.

There is one alternate way of declaring the ngTemplateOutlet. The result will be the same as the method shown above.

  *ngTemplateOutlet="linkLayout; context: { link: link }"


The above method limits the duplication to a certain degree, especially for the content inside the a tag. The example here is a fairly simple layout. This method becomes more useful when the internal layout becomes more complicated. That inner layout is defined once and reused in multiple locations. You could create a new component if you wanted, but that can introduce complexity sometimes as well.

Knowing how to use ng-template, ng-container, and ngTemplateOutlet can allow you to effectively output the content of a component with minimal duplication.

Original article source at:

#angular #ng #template 

How to Reusable Component Pieces with ngTemplate Outlet

How to Use infracost CI Template for Gitlab To Forecast Cost

Infracost is an open-source tool used to forecast & estimates your cloud cost on every pull request on terraform.

Multiple scenarios & scripts can be created to forecast cloud costs. It supports AWS, Azure, GCP cloud platforms & over 230 Terraform resources.

It also works with Terraform Cloud & Terragrunt. Infracost can use hosted Cloud Pricing API or self-host.

Infracost can be integrated with any CICD tool which will break down the cost of new terraform resources every time a Pull request or Merge request is created. In this blog, we will see how we can use Gitlab CI templates for the merge request pipeline to estimate & forecast cloud costs.


  • Gitlab knowledge
  • Gitlab Repo
  • CICD variables

Directory Structure

The directory structure for your application or pipeline repo should look like this. Command to check directory structure is tree -I .git -a

tree -I .git -a

The output will look like this:

├── .gitlab
│   └── plan-json.yml
├── .gitlab-ci.yml
└── terraform
    ├── .infracost
    │   └── terraform_modules

Steps to create job template

1. Create .gitlab-ci.yml file in the main directory. The main Gitlab pipeline is defined in .gitlab-ci.yml file.

This acts as parent job which triggers a downstream pipeline that is called the child pipeline.

- all_stage

  stage: all_stage
  - if: "$CI_COMMIT_TAG"
    include: ".gitlab/plan-json.yml"
    strategy: depend

2. Create GitLab merge request job template.

Create a file plan-json.yml & copy the below content in it. This will act as downstream pipeline triggered by the parent pipeline.

  - if: "$CI_COMMIT_TAG"

  # If your terraform files are in a subdirectory, set TF_ROOT accordingly
  TF_ROOT: terraform

  - plan
  - infracost

  key: "${TF_ROOT}"
    - ${TF_ROOT}/.terraform

  stage: plan
    name: hashicorp/terraform:latest
    entrypoint: [""]
    - cd ${TF_ROOT}
    - terraform init
    - terraform plan -out tfplan.binary
    - terraform show -json tfplan.binary > tplan.json
      - ${TF_ROOT}/tplan.json

  stage: infracost
    name: infracost/infracost:ci-0.10
    entrypoint: [""] 
    - plan
    - git clone $CI_REPOSITORY_URL --branch=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME --single-branch /tmp/base
    - ls /tmp/base
    - infracost configure set api_key $INFRACOST_API_KEY
    - infracost breakdown --path=/tmp/base/${TF_ROOT} --format=json --out-file=infracost-base.json
    - INFRACOST_ENABLE_CLOUD=true infracost diff --path=${TF_ROOT} --compare-to=infracost-base.json --format=json --out-file=infracost.json
    - infracost comment gitlab --path=infracost.json --repo=$CI_PROJECT_PATH --merge-request=$CI_MERGE_REQUEST_IID --gitlab-server-url=$CI_SERVER_URL --gitlab-token=$GITLAB_TOKEN --behavior=update


Explanation: First this downstream pipeline creates terraform plan in JSON from the current branch. Then it plans out in JSON but from the target branch that is main in this case. Then it compares both terraform plans & breakdowns the cost difference and finally comments on the merge request.

3. Now whenever you create a MR in Gitlab it will forecast terraform infrastructure cost for you

  1. Checkout a branch from Master
  2. Make some changes in terraform file
  3. Push the newly created branch
  4. Create an MR on the base main branch
  5. The pipeline will automatically trigger as soon as MR is created.

When pipeline succeeds It will comment down on your MR with cost estimation & breakdowns


  • Use extends: keyword to extend this job template.
  • (Optionally) You can keep this stage as it is and apply rules to control the behavior of the job.
  • Put your terraform code into terraform/ dir.
  • Create a MR on your GitLab repo.


Infracost is used to forecast cloud infra costs before it creates any resources. You can integrate this tool with any CICD to forecast cost whenever a pull or merge request is created.

Original article source at:

#gitlab #ci #template 

How to Use infracost CI Template for Gitlab To Forecast Cost

How to Automation Of Create SharePoint Site using Custom Site Template

SharePoint Online is being used by many organizations not only for collaboration and document management but it is used for several business activities which involve similar types of custom sites.

Let’s take an example project site. User creates a separate site to manage each of the project where the architecture, configuration, and design of the site are the same. SharePoint provides the ability to create a Site Template using an existing site using PnP PowerShell Script.

I am describing here the steps to create a SharePoint site automatically using the existing site template. In this article, we will be using SharePoint List, Power Automate, Azure Automation, and Azure Runbook.

First create a template file using the existing SharePoint Site using below PowerShell Script

$TemplateSiteUrl = ""
$TemplateFile = "\TemplateFile.xml"
Connect - PnPOnline - Url $TemplateSiteUrl - PnPManagementShell
Get - PnPSiteTemplate - Out $SiteTemplateFile

The above script creates a XML file called TemplateFile.xml. Upload this file to a SharePoint Library somewhere so that we can use it each time by PowerShell to create a new site.

Now login to Azure Portal and create an Automation Account.

Once automation account is created, then go to automation account.

First you need to install the module you require to run the PowerShell.

Click the “Modules” under “Shared Resource” from the left panel and click the “Browse Gallery”

Automation of creating SharePoint Site using custom site template

Then search the pnp.powershell. This will show the module and select.

Automation of creating SharePoint Site using custom site template

When you installed the required modules, go to the Runbook.

You will see a Runbook under Process Automation in the left panel.

Automation of creating SharePoint Site using custom site template

Click the runbook and create a new runbook. Provide the name of runbook, select PowerShell as runbook type, runtime version, and description.

More details about the runbook

Once runbook is created, go to runbook. You will find "Edit" link on top with other links.

Automation of creating SharePoint Site using custom site template

Click the edit link. You will find an editor to put your PowerShell Script. Now enter the below PowerShell Script. We will be passing SiteURL as parameter.

    [parameter(Mandatory = $true)]
    [string] $SiteURL = "")
$UserName = ""
$Password = "xxxxxxxxx"
$SecurePassword = ConvertTo - SecureString - String $Password - AsPlainText - Force
$Cred = New - Object - TypeName System.Management.Automation.PSCredential - argumentlist $UserName, $SecurePassword
#Above line will connect SharePoint Site
Connect - PnPOnline - Url "" - Credentials $Cred
$fileRelativeURL = "/sites/SiteName/shared Documents/TemplateFile.xml"
#Download template xml file.
$file = Get - PnPFile - Url $fileRelativeURL - AsFile - Path c: \temp - Filename " TemplateFile.xml"
# Connect new site where template will be implemented.
Connect - PnPOnline - Url $SiteURL - Credentials $Cred
#Implement the template.
Invoke - PnPSiteTemplate - Path "c:\temp\TemplateFile.xml" - ClearNavigation

After putting the script, click Save and Publish the runbook.

Now Create a SharePoint List that will contain a list of projects.

Then create a new flow using Power Automate connected to the above list triggered “When an item is created” so that flow trigger as soon as a new item is created in the list. Add next steps in the flow as “Send an HTTP request to SharePoint” and put the details as below:

Site Address: Your SharePoint site address
Method: POST
Uri: /_api/SPSiteManager / create
Headers: accept - application / json;
odata.metadata = none
Body: {
    "request": {
        "Title": "Site Name returned from list",
        "Url": "",
        "Lcid": 1033,
        "ShareByEmailEnabled": false,
        "Description": "Description of site",
        "WebTemplate": "STS#0",
        "Owner": "",

Microsoft Power Automate has connector available to connect with a runbook under an automation account. Add an action and select "Azure Automation" connector, then select “Create a job” from the list of actions.

This will require your azure details like subscriptions, resource group, automation account, and runbook. When you select your runbook, it will prompt for parameter defined in the runbook. Pass the parameter and save. This will call the script and pass the parameter to script.

You can add more actions in the flow like updating a list or sending a notification mail etc.

Your flow will look like below.

Automation of creating SharePoint Site using custom site template

Now automation is ready.

Please create a new item to the list. It will trigger the flow and create a new site with custom template.

Original article source at:

#sharepoint #template 

How to Automation Of Create SharePoint Site using Custom Site Template
Royce  Reinger

Royce Reinger


Ivy: The Unified Machine Learning Framework



Ivy is an ML framework that currently supports JAX, TensorFlow, PyTorch, and Numpy. We’re very excited for you to try it out!

Next on our roadmap is to support automatic code conversions between all frameworks 🔄, and add instant multi-framework support for all open-source libraries with only a few lines of code changed! Read on to learn more 😊

The docs are split into a number of sub-pages explaining different aspects of why we created Ivy, how to use it, what we’ve got planned on our roadmap, and how to contribute! Click on the sub-headings below to check out these pages!

We use 🚧 to indicate that the feature being discussed is in development. We use ✅ to indicate that it is already implemented!

Check out the docs for more info, and check out our Google Colabs for some interactive demos!

🚨 Ivy is still at a relatively early stage of development. Expect breaking changes and sharp edges until we release version 1.2.0 in the next few weeks!

If you would like to contribute, please check out our contributor guide, and take a look at the open tasks if you'd like to dive straight in! 🧑‍💻

Quick Start

Ivy can be installed like so: pip install ivy-core You can immediately use Ivy to train a neural network, using your favorite framework in the background, like so:

import ivy

class MyModel(ivy.Module):
    def __init__(self):
        self.linear0 = ivy.Linear(3, 64)
        self.linear1 = ivy.Linear(64, 1)

    def _forward(self, x):
        x = ivy.relu(self.linear0(x))
        return ivy.sigmoid(self.linear1(x))

ivy.set_backend('torch')  # change to any backend!
model = MyModel()
optimizer = ivy.Adam(1e-4)
x_in = ivy.array([1., 2., 3.])
target = ivy.array([0.])

def loss_fn(v):
    out = model(x_in, v=v)
    return ivy.mean((out - target)**2)

for step in range(100):
    loss, grads = ivy.execute_with_gradients(loss_fn, model.v)
    model.v = optimizer.step(model.v, grads)
    print('step {} loss {}'.format(step, ivy.to_numpy(loss).item()))

print('Finished training!')

This example uses PyTorch as a backend framework, but the backend can easily be changed to your favorite frameworks, such as TensorFlow, or JAX.

Framework Agnostic Functions

In the example below we show how Ivy's concatenation function is compatible with tensors from different frameworks. This is the same for ALL Ivy functions. They can accept tensors from any framework and return the correct result.

import jax.numpy as jnp
import tensorflow as tf
import numpy as np
import torch

import ivy

jax_concatted   = ivy.concat((jnp.ones((1,)), jnp.ones((1,))), -1)
tf_concatted    = ivy.concat((tf.ones((1,)), tf.ones((1,))), -1)
np_concatted    = ivy.concat((np.ones((1,)), np.ones((1,))), -1)
torch_concatted = ivy.concat((torch.ones((1,)), torch.ones((1,))), -1)

To see a list of all Ivy methods, type ivy. into a python command prompt and press tab. You should then see output like the following:

ivy.Container(                         ivy.general                               ivy.reduce_min(
ivy.abs(                               ivy.get_device(                           ivy.reduce_prod(
ivy.acos(                              ivy.get_num_dims(                         ivy.reduce_sum(
ivy.acosh(                             ivy.gradient_descent_update(              ivy.reductions
ivy.activations                        ivy.gradient_image(                       ivy.relu(
ivy.arange(                            ivy.gradients                             ivy.reshape(
ivy.argmax(                            ivy.identity(                             ivy.round(
ivy.argmin(                            ivy.image                                 ivy.scatter_nd(
ivy.array(                             ivy.indices_where(                        ivy.seed(
ivy.asin(                              ivy.inv(                                  ivy.shape(
ivy.asinh(                             ivy.layers                                ivy.shuffle(
ivy.atan(                              ivy.leaky_relu(                           ivy.sigmoid(
ivy.atan2(                             ivy.linalg                                ivy.sin(
ivy.atanh(                             ivy.linear(                               ivy.sinh(
ivy.bilinear_resample(                 ivy.linspace(                             ivy.softmax(
ivy.cast(                              ivy.log(                                  ivy.softplus(
ivy.ceil(                              ivy.logic                                 ivy.split(
ivy.clip(                              ivy.logical_and(                          ivy.squeeze(
ivy.concatenate(                       ivy.logical_not(                          ivy.stack(
ivy.container                          ivy.logical_or(                           ivy.stack_images(
ivy.conv2d(                            ivy.math                                  ivy.stop_gradient(
ivy.core                               ivy.matmul(                               ivy.svd(
ivy.cos(                               ivy.maximum(                              ivy.tan(
ivy.cosh(                              ivy.minimum(                              ivy.tanh(
ivy.cross(                             ivy.neural_net                            ivy.tile(
ivy.cumsum(                            ivy.nn                                    ivy.to_list(
ivy.depthwise_conv2d(                  ivy.norm(                                 ivy.to_numpy(
ivy.dtype(                             ivy.one_hot(                              ivy.transpose(
ivy.execute_with_gradients(            ivy.ones(                                 ivy.unstack(
ivy.exp(                               ivy.ones_like(                            ivy.variable(
ivy.expand_dims(                       ivy.pinv(                                 ivy.vector_to_skew_symmetric_matrix(
ivy.flip(                              ivy.randint(                              ivy.verbosity
ivy.floor(                             ivy.random                                ivy.where(
ivy.floormod(                          ivy.random_uniform(                       ivy.zero_pad(
ivy.backend_handler                    ivy.reduce_max(                           ivy.zeros(
ivy.gather_nd(                         ivy.reduce_mean(                          ivy.zeros_like(


(a) ML Explosion

A huge number of ML tools have exploded onto the scene!

(b) Why Unify?

Why should we try to unify them?

(c) Standardization

We’re collaborating with The Consortium for Python Data API Standards


Ivy can fulfill two distinct purposes:

1. Serve as a transpiler between frameworks 🚧

2. Serve as a new ML framework with multi-framework support ✅

The Ivy codebase can then be split into three categories, and can be further split into 8 distinct submodules, each of which falls into one of these three categories as follows:

(a) Building Blocks

Backend functional APIs ✅

Ivy functional API ✅

Backend Handler ✅

Ivy Compiler 🚧

(b) Ivy as a Transpiler

Front-end functional APIs 🚧

(c) Ivy as a Framework

Ivy stateful API ✅

Ivy Container ✅

Ivy Array 🚧


(a) Applied Libraries

Ivy libraries in mechanics, vision, robotics, memory, and other areas

(b) Builder [page coming soon!]

ivy.Trainer, ivy.Dataset, ivy.Dataloader and other helpful classes and functions for creating training workflows in only a few lines of code


Join our community as a code contributor, and help accelerate our journey to unify all ML frameworks! Check out all of our open tasks, and find out more info in our Contributing guide!


  title={Ivy: Templated deep learning for inter-framework portability},
  author={Lenton, Daniel and Pardo, Fabio and Falck, Fabian and James, Stephen and Clark, Ronald},
  journal={arXiv preprint arXiv:2102.02886},

Download Details:

Author: unifyai
Source Code: 
License: Apache-2.0 license

#machinelearning #python #template #deeplearning 

 Ivy: The Unified Machine Learning Framework
Gordon  Matlala

Gordon Matlala


Resume: A Minimalist Resume Template for Jekyll and Hexo


A Minimalist Resume Template for Jekyll and Hexo


This is a responsive minimal résumé template made by Crisp, powered by Jekyll. And we also provide an official Hexo port for Hexo users.

You may config all the data in yaml and make it your own résumé. Then, you might use on GitHub Pages, your website, or wherever you want.

English 简体中文



  • Simple, elegant, and minimal design
  • PC and mobile friendly, but it looks better on PC
  • PDF supports and print friendly
  • Flexible and extensible


Local Mode

Clone the repo

git clone

Install Jekyll

gem install jekyll

Config your résumé data

The baseurl is required in _config.yml if you serve this page as part of your website. And your contact information, EDUCATION, SKILLS, EXPERIENCE, and PROJECTS data will be set in _data/resume.yml.

Run and Debug

jekyll serve


jekyll build

Gem-based Theme

Create a Gemfile

source ""

gem "jekyll-theme-minimal-resume"

And then,

bundle install

Init _config.yml

title: Résumé Title
baseurl: "/resume/"
theme: "jekyll-theme-minimal-resume"

Create a index.html

layout: resume

Create _data/resume.yml and fill in your resume data. Example data is available here.

Data Format


  - icon: fa-envelope
  - icon: fa-phone-square
    text: your-phone-num
  - icon: fa-globe

FontAwesome iconfont is embedded, so use the fa- class name as icon. link is optional, present if you want a link for your web version.


There are a set of colorscheme. color may be specified in _config.yml. The default colorscheme is gray.

color: gray

Colors powered by Open-Color:

  • red
  • pink
  • grape
  • violet
  • indigo
  • blue
  • cyan
  • teal
  • green
  • lime
  • yellow
  • orange

Colors powered by Nord:

  • nord

Extending Sections

Add new section in _data/resume.yml

  - name: English
    proficiency: Professional working proficiency
  - name: Mandarin Chinese
    proficiency: Native or bilingual proficiency

Add section to _layouts/resume.html:

<section id="languages">
  <div class="section-title">Language</div>
  <div class="section-content">
    {% for lang in %}
    <div class="block">
      <div class="block-title">{{ }}</div>
      <div class="block-content">{{ lang.proficiency }}</div>
    {% endfor %}


Feel free to add yours here.

Download Details:

Author: Crispgm
Source Code: 
License: MIT license

#jekyll #resume #template #theme 

Resume: A Minimalist Resume Template for Jekyll and Hexo
Gordon  Matlala

Gordon Matlala


Neumorphism Designed Jekyll Theme for Personal Websites


Neumorphism designed Jekyll theme for personal websites, portfolios and resumes.

About The Project

Project Screenshot

This is a personal website built with Jekyll and hosted on Github Pages, which is based on the new Neumorphism design trend and was developed with a mobile-first approach. This can be used by developers, who want to showcase their resume and portfolio. If you want to use this for your own website, fork this repository and then refer to personalize and customize.

Built With


Getting Started

To get a local copy up and running follow these simple steps.

The commands and instructions I provide are for MacOS - please look up the specific commands for your OS on your own.


brew install node

If you need to switch between Node versions regurlarly, I would recommend to install Node via Node Version Manager.

gem install bundler jekyll

For more information, refer to this.

npm install -g yarn


Recommended way: If you want to contribute to this theme or open issues due to problems implementing this on your own, I would recommend forking the repository directly. This makes it easier for me to solve open issues and questions or check pull requests.

1.1: Fork the repository (using the Fork button at the top) and then clone the repository

# Replace {YOUR_USERNAME} with your actual username
git clone{YOUR_USERNAME}/neumorphism.git


1.2: Create your own repository (using the green Use this template button at the top) and then clone the repository

# Replace {YOUR_USERNAME}, {YOUR_REPOSITORY} with the actual values

2: Change directory into neumorphism

cd neumorphism

3: Install dependencies

bundle install


  • Run and develop locally with live server at http://localhost:4000, this will also build production-ready JS and SCSS assets with every change
  • After committing and pushing, see the Settings page of your repository to see where your site is published at via Github Pages.

Personalize and Customize


Edit _config.yml to personalize your site. For documentation, refer to docs/

Github Metadata Plugin

If you want to automatically have your Github repositories pulled for the Open Source Projects section, then you also need to authenticate yourself for the Github Metadata plugin to work.

You need to generate a new personal access token on GitHub:

  • Go to the Github Token site
  • Select the scope public_repository, and add a description.
  • Confirm and save the settings. Copy the token you see on the page.
  • Create a .env file inside your repository and add your generated JEKYLL_GITHUB_TOKEN:

To complete the configuration for the Github Metadata plugin, you also need to change the value of repository inside _config.yml. After this, you should the Github Metadata plugin should work properly.

For optimal results, you should make sure, that every Github project, you want included on this portfolio, has added following informations on Github:

  • Description
  • Homepage link, if there is a live version of it
  • Topics

Example: Github Repository Information Example


Edit files inside _data to add information to the portfolio. For documentation, refer to docs/


Edit assets/particles.json to customize the landing page backgorund animation. For more information, refer to this.


Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request


Download Details:

Author: longpdo
Source Code: 
License: MIT license

#jekyll #theme #template #githubpages 

Neumorphism Designed Jekyll Theme for Personal Websites
Gordon  Matlala

Gordon Matlala


Airspace-jekyll: A Port Of The Airspace Theme By ThemeFisher to Jekyll

Airspace for Jekyll

This Jekyll theme is a port of ThemeFisher's Airspace template, originally ported by @ndrewtl. It is released under ThemeFisher's license , which requires attribution. Concern about the licnese please contact with them



To start your project, fork this respository, put in your content, and go!


Here are some projects that have used this Jekyll Theme:

Steps for Setup:

Make sure you have Ruby

First, make sure you have Ruby installed. You can confirm this by running ruby -v on the command line:

$ ruby -v
ruby [version number] (date) [your platform]

If you get something like "Error, command not found" visit the link above and install Ruby for your platform.

Make sure you have Bundler

Next, make sure you have Bundler installed. Just like above, run bundle -v on the command line:

$ bundle -v
bundle [version number]

If you get "Error, command not found" run gem install bundler to install it using RubyGems.

Run this repository

Clone the repository, and cd into it:

$ git clone
$ cd airspace-jekyll

Install dependencies locally:

$ bundle install --path vendor/bundle

This should install a local copy of jekyll.

Now run the server:

$ ./vendor/bundle/ruby/#{YOUR_RUBY_VERSION}/bin/jekyll server

Download Details:

Author: ndrewtl
Source Code: 
License: View license

#jekyll #theme #template 

Airspace-jekyll: A Port Of The Airspace Theme By ThemeFisher to Jekyll
Gordon  Matlala

Gordon Matlala


Base-jekyll-template: Knowledge Base Template for Jekyll


Knowledge base template for Jekyll. Browse through a live demo.

Base was made by CloudCannon, the Cloud CMS for Jekyll.

Find more templates, themes and step-by-step Jekyll tutorials at CloudCannon Academy.

Base template screenshot


  • Tutorials organised by category
  • Two types of tutorials - text and video
  • Ability to have a "tutorial series"
  • FAQ section
  • Disqus comments
  • Sticky sidebar for main headings in tutorials
  • Optimised for editing in CloudCannon
  • RSS/Atom feed
  • SEO tags
  • Google Analytics


  1. Add your site and author details in _config.yml.
  2. Add your Google Analytics, Disqus and MailChimp keys to _config.yml.
  3. Get a workflow going to see your site's output (with CloudCannon or Jekyll locally).


Base was built with Jekyll version 3.4.3, but should support newer versions as well.

Install the dependencies with Bundler:

$ bundle install

Run jekyll commands through Bundler to ensure you're using the right versions:

$ bundle exec jekyll serve


Base is already optimised for adding, updating and removing tutorials, navigation, footer and FAQ information in CloudCannon.

The sticky sidebar in tutorials in populated by pulling out <h2> elements from the content.


  • Add, update or remove a post in the Posts collection.
  • The tutorials page is organised by categories.
  • Change the defaults when new posts are created in _posts/

Post Series

To create a new series:

  • Add a new document to the sets collection.
  • Set the title and description.

To add a tutorial/post to a series:

  • Add a set field to the tutorial front matter which points to the file name of the desired set without the .md extention. e.g. If I have a set at _sets/ I would use this in my tutorial front matter: set: getting-started.
  • Add a order_number field to the tutorial front matter and specify a number. This is the tutorials order in the set.


  • Exposed as a data file to give clients better access.
  • Set in the Data / Navigation section.


  • Exposed as a data file to give clients better access.
  • Set in the Data / Footer section.

Download Details:

Author: CloudCannon
Source Code: 
License: MIT license

#jekyll #template #theme 

Base-jekyll-template: Knowledge Base Template for Jekyll
Gordon  Matlala

Gordon Matlala


Edition-jekyll-template: Product Documentation Template for Jekyll


Product documentation template for Jekyll. Browse through a live demo. Start documenting your product, application, service or website with this configurable theme.

Edition was made by CloudCannon, the Cloud CMS for Jekyll.

Find more templates, themes and step-by-step Jekyll tutorials at CloudCannon Academy.

Edition template screenshot


  • Two column layout
  • Full text search
  • Pre-styled components
  • Auto-generated navigation based on category
  • Optimised for editing in CloudCannon
  • Change log
  • RSS/Atom feed
  • SEO tags
  • Google Analytics


  1. Add your site and author details in _config.yml.
  2. Get a workflow going to see your site's output (with CloudCannon or Jekyll locally).


Edition was built with Jekyll version 3.3.1, but should support newer versions as well.

Install the dependencies with Bundler:

$ bundle install

Run jekyll commands through Bundler to ensure you're using the right versions:

$ bundle exec jekyll serve


Edition is already optimised for adding, updating and removing documentation pages in CloudCannon.

Documentation pages

  • Add, update or remove a documentation page in the Documentation collection.
  • Change the category of a documentation page to move it to another section in the navigation.
  • Documentation pages are organised in the navigation by category, with URLs based on the path inside the _docs folder.

Change log

  • Add, update or remove change log entries from your posts.
  • Tag entries as minor or major in the front matter.


  • Add excluded_in_search: true to any documentation page's front matter to exclude that page in the search results.


  • Change site.show_full_navigation to control all or only the current navigation group being open.

Download Details:

Author: CloudCannon
Source Code: 
License: MIT license

#jekyll #template #theme 

Edition-jekyll-template: Product Documentation Template for Jekyll
Gordon  Matlala

Gordon Matlala


Aviator-jekyll-template: API Documentation Template for Jekyll


API documentation template for Jekyll. Browse through a live demo. Start documenting your API with this configurable theme.

Aviator was made by CloudCannon, the Cloud CMS for Jekyll.

Find more templates, themes and step-by-step Jekyll tutorials at CloudCannon Academy.

Aviator template screenshot


  • Three column layout
  • Fully responsive
  • Full text search
  • Pre-styled components
  • Auto-generated navigation based on category
  • Optimised for editing in CloudCannon
  • SEO tags
  • Google Analytics


  1. Add your site and author details in _config.yml.
  2. Get a workflow going to see your site's output (with CloudCannon or Jekyll locally).


Aviator was built with Jekyll version 3.7.2, but should support newer versions as well.

Install the dependencies with Bundler:

$ bundle install

Run jekyll commands through Bundler to ensure you're using the right versions:

$ bundle exec jekyll serve


Aviator is already optimised for adding, updating and removing documentation pages in CloudCannon.


  • Each section is a different collection, this helps organise your content.
  • Set the order of the collections with the position_number field in collection configuration in _config.yml.
  • Set the order of the documents inside a collection by setting the position_number in front matter.


  • Add excluded_in_search: true to any documentation page's front matter to exclude that page in the search results.

Download Details:

Author: CloudCannon
Source Code: 
License: MIT license

#jekyll #template #theme 

Aviator-jekyll-template: API Documentation Template for Jekyll
Gordon  Matlala

Gordon Matlala


Space-jekyll-template: A Simple Spacemacs Template on Jekyll

Space Jekyll

A simple and elegant Jekyll theme based on Spacemacs. The theme works well on mobile devices as well.

Site/User Settings

customize your site in _config.yml

# Site settings
description: A blog about lorem ipsum
baseurl: "" # the subpath
url: "" # the base hostname &/|| protocol for your site

# User settings
username: Lorem Ipsum
user_description: Lorem Developer
user_title: Lorem Ipsum
twitter_username: loremipsum
github_username:  loremipsum
gplus_username:  loremipsum
disqus_username: loremipsum

See more about project and links in _config.yml

How to create a post ?

_posts create a file .md with structure:

layout: post
title: "Lorem ipsum speak.."
date: 2016-09-13 01:00:00
image: '/assets/img/post-image.png'
description: 'about tech'
- lorem
- tech
- Lorem ipsum
twitter_text: 'How to speak with Lorem'

How to insert new links on menu navigation ?

You should open _config.yml and change/add links section:

  section_1: # you can use any name
    - title: home # show on menu
      url: / #link
      key_trigger: 1 # link shortcut and show on the left of the title
    - title: my posts
      url: /posts
      key_trigger: 2
    - title: series
      url: /series
      key_trigger: 3
    - title: tags
      url: /tags
      key_trigger: 4
    - title: about me
      url: /about
      key_trigger: 5

Frontend Technologies

  • Gulp: The streaming build system.
  • Stylus: expressive, dynamic, robust CSS.
  • BrowserSync: Time-saving synchronised browser testing.
  • Rupture: Simple media queries for stylus.
  • Kouto-Swiss: A complete CSS framework for Stylus.
  • Jeet: A grid system for human.
  • Zepto.js: The aerogel-weight jQuery-compatible JavaScript library.

How can I modify the theme ?

First, install jekyll and node.js.

  1. Fork the theme with your username, example:
  2. Clone repository to your computer
  3. run npm install
  4. run gulp
  5. Be happy by modifying the files

Space Jekyll uses the Stylus to process his css, then modifies the style of the theme in this folder.

You can go in the variable.styl and modify the colors.

See a live demo here.

Download Details:

Author: Victorvoid
Source Code: 
License: View license

#jekyll #template #theme 

Space-jekyll-template: A Simple Spacemacs Template on Jekyll
Gordon  Matlala

Gordon Matlala


Simple Jekyll Theme for A Minimal Resume Website

Jekyll Resume Theme


Quick Setup

  1. Install Jekyll: gem install jekyll bundler
  2. Fork this repository and clone your fork
  3. Edit _config.yml to personalize your site


You have to fill some informations on _config.yml to customize your site:

Site settings

description: A blog about lorem ipsum dolor sit amet
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://localhost:3000" # the base hostname & protocol for your site

User settings

username: Lorem Ipsum
user_description: Software Engineer at Lorem Ipsum Dolor
user_title: Mauricio Urraco

Don't forget to change your URL before you deploy your site!

Color and Particle Customization

  • Color Customization
    • Edit the .sass variables
  • Particle Customization
    • Edit the json data in particle function in app.js
    • Refer to Particle.js for help


You can (and should) edit the .html files for adding your own information, icons, working experience, social links or whatever you want to add. I.e.:

<a aria-label="My Github" target="_blank" href="">
  <i class="icon fa fa-github-alt" aria-hidden="true"></i>

Running locally

In order to compile the assets and run Jekyll locally you need to follow those steps:

  1. Install Jekyll
  2. Run bundle install
  3. Run bundle exec jekyll build
  4. Start and http-server in the folder _site


  • Report issues
  • Open pull request with improvements
  • Spread the word
  • Reach out to me directly at


Live demo at

Download Details:

Author: Murraco
Source Code: 
License: MIT license

#jekyll #resume #theme #template 

Simple Jekyll Theme for A Minimal Resume Website
Gordon  Matlala

Gordon Matlala


Free to Use Static Generated Website Template for Your Mobile App

Mobile App Landing Page Template

📱 Free to use static generated landing page template for your mobile app

💡 Features

Mobile App Landing Page Template comes with pre-installed features and options:

  • Display app icon
  • Show unlimited app screenshots
  • Link to Google Play
  • Link to the AppStore
  • Link to the Web App
  • Press mention section
  • Product Hunt floating prompt
  • Privacy policy Page
  • Google Analytics
  • Cookie Consent
  • Automatic dark theme
  • Doorbell widget
  • Github forking banner

✨ Demo

Check out websites using the Mobile App Template:

📖 How to use

The normal way

  1. Fork this project
  2. Edit _config.yml, feel free to commut/uncomment what you need (google analtytics, or github for example)
  3. Edit _data/app.yml with your app data
  4. Update the text from _data/strings.yml, you can customize there the footer's links
  5. Edit icons and screenshots inside the _images folder and icon.png in the root
  6. Edit _src/index.js to update the product hunt modal (or to remove it) and to remove the darkmode plugin if you don't want it
  7. Deploy (on netlify, gitpages or surge, they are all free)

The no-code way

  1. Go to
  2. Edit the settings on the left part
  3. Click on the Publish button then Save Webpage as .zip
  4. Unzip and upload the folder to your server (you can drag'n'drop it in Netlify to host it there for free)

⚙️ How to run


  • NodeJS
  • Ruby, Bundler


npm install
bundler install


npm start


npm run build

Deploy to netlify (for free)

Deploy to Netlify

More documentation

This templates uses Jekyll-webpack-boilerplate, read more documentation there.

🤝 Contributing

Contributions, issues and feature requests are welcome!

Download Details:

Author: Sandoche
Source Code: 
License: MIT license

#jekyll #android #template #ios #mobile 

Free to Use Static Generated Website Template for Your Mobile App