Home

GraphQL server with Gqlgen and PostgreSQL

Create graphQL server using gqlgen following gqlgen tutorial mkdir gqlgen-users cd gqlgen-users go mod init github.com/[username]/gqlgen-users Create tools.go with gqlgen ...

Using GORM library to access postgreSQL with JSONB field with GoLang

This tutorial demonstrates how to 'auto migrate' the DB and how to store and retrieve data  from JSONB field in ...

Sign, Verify and decode JWT

  https://github.com/ToniNichev/tutorials-encodeDecodeJWT Json Web Token become widely popular for creating data with optional signature and/or optional encryption and payload. JWTs ...

In-app purchase with server to server notifications

 GitHub Repo
  • Contains these projects:
    • iOS-App (The iOS app that could be used to test the in-app purchase)
    • ...

Adding Google sign-in in iOS with SwiftUI

 Git Hub Repo Google also has a great tutorial here: Get started with Google Sign-In for iOS and macOS Pre-requirements: ...

Using EnvironmentObject to share data between views

// // ContentView.swift // Test // // Created by Toni Nichev on 1/3/24. // import SwiftUI // Our observable object ...

Set up GraphQL with gqlgen and golang

The goal: setting up GraphQL server using Gqlgen library. We are going to set up GraphQL server with Users, and ...

Different ways to use oAuth in your WebAp

Using full redirect This way after clicking on log-in button user is redirected to the sign-in page with all sign-in ...

Zigzag Conversion

[tabby title="Task"] The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want ...

Using mkcert to create locally-trusted development certificates.

mkcert git repo Creating certificate files
  1. Navigate to desired location where the certificate will be created (for example $ ...

Log In With Apple using redirect pop-up

This tutorial demonstrates how to use oAuth to sign-in with Apple without using any library.We simply use HTTP GET request ...

Using Oauth2 to sign-in users with Apple using Java Script Library

Example project here <html> <head> <style> h1 { text-align: center; } #welcomePanel { display: none; text-align: center; } #signInPanel h2 ...

Sign-in with Apple prerequisite

In order to add Sign-In with Apple we have to do the following:
  1. Create an App ID.
  2. Create a ...

Using oAuth2.0 to sign-in with Google using redirect method

No library required Log In With Google Example In this example we have the main app (in this case my ...

Using Oauth2 to sign-in users with Google using Google Java Script Library

Example project here:  Sign-in with Google using Google Java Script library
  • Main project
<head> <style> #signIn { width: ...

Using JavaScript find to search array of object

var arr = [ {one: 1}, {one: 2} ] var result = arr.find( obj => obj.one > 1 ); console.log(result); ...

Simple use of Java Script spread operator

Converting array into object // The array var numbers = [1,2,3]; var obj = {...numbers } console.log(obj) // result: {0:1, ...

Longest Common Substring

[tabby title="Task"] Given two strings text1 and text2, return the length of their longest common subsequenceIf there is no common subsequence, return 0. A subsequence of a string is ...

Copy List with Random Pointer

[tabby title="Task"] A linked list of length n is given such that each node contains an additional random pointer, which could point ...

Range Sum of BST

[tabby title="Task"] Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with ...

Graph traversal

The graph The graph represent connections between airports. Nodes (vertices)  represent airports, and  edges represent flights. BFS search (Breadth First ...

Moving Average from Data Stream

[tabby title="Task"] Given a stream of integers and a window size, calculate the moving average of all integers in the ...

Heaps or priority queues in Java Script

Still work in progress ... Part I Heapify ... Part II sort and heapify We start swapping values and heapify ...

Implement pow(x, n)

[tabby title="Task"] Implement pow(x, n), which calculates x raised to the power n (i.e., xn). Example 1: Input: x = 2.00000, n = 10 Output: 1024.00000 ...

regular JavaScript functions vs array functions

Does not have its own bindings to this or super, and should not be used as methods. var obj1 = { a: 123, b: ...

JavaScript call, bind and apply simple

According MDN all three methods are very similar, and at the end they produce very similar result.

Longest Common Prefix

[tabby title="Task"] Write a function to find the longest common prefix string amongst an array of strings. If there is ...

Roman to Integer

[tabby title="Task"] Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol                Value I ...

Container With Most Water

[tabby title="Task"] Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that ...

How to solve “Can’t perform a React state update on an unmounted component”

The scenario - Let's imagine that you have a card component that you could show and hide with a button ...

Install SonarQube and add it as a verification step in Jenkins

Install SonarQube Instructions Install SonarQube. This is a reporting tool. $ brew install sonar But it also requires Sonar-scanner in ...

Working with danger JS and integrating it with GitHub

What is danger JS ? Danger runs during your CI process, and gives teams the chance to automate common code ...

Adding continuous integration with Jenkins pipeline and Github webhooks

Pre requirements:
  • Windows, Linux or OSX machine running latest Java JDK or JRE.
  • Github account
  • You could fork the ...

Using Nginx as a reverse proxy and add source code replacement

Task: I have web app (in my case Node app running on port 3000) I would add Nginx in front ...

Unique-paths

[tabby title="Task"] A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot ...

Intersection of Two Linked Lists

[tabby title="Task"] Write a program to find the node at which the intersection of two singly linked lists begins. For ...

Check if string has all unique characters

[tabby title="Task"] Implement an algorithm to determine if a string (of characters from ‘a’ to ‘z’) has all unique characters ...

LRU Cache

[tabby title="Task"] Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - ...

Trapping Rain Water

[tabby title="Task"] Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how ...

Web Components: create text field with autosuggest dropdown and dictionary

What are web components? Web components are new reusable components that add new functionalities to a standard components (ie: img, ...

Array VS Hash Table

Hash table tutorial Find element in Array function fuindInArray() { var t0 = performance.now(); for(var q = 0; q < ...

Sort an array

[tabby title="Task"] Given an array of integers nums, sort the array in ascending order. Example 1: Input:  [5,2,3,1] Output: [1,2,3,5] Example ...

Majority element in array

[tabby title="Task"] Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ ...

Creating loader component and set up one CSS per brand.

Previous solution was great but not perfect. We still add a CSS of two brands in one CSS file and ...

Adding multiple brands and applications

Let's make the task more challenging and assume that we are going to have two different Brands (or apps) one.localhost.com, ...

Adding html.js component

Let's clean up the code a bit and move the html code from ./ssr-server.js to a separate component called html.js ...

Sorting algorithms

[tabby title="Task"] Sort an array of integers in descending order. Example: Given an array of 4 elements [3,15,1,5] Produce an ...

Simple caching using browser’s service workers.

A service worker API is relatively new technology, allowing for running a special type of web worker (a JavaScript), that ...

Simple use of Promises in JavaScript

Here is a simple and a bit silly example of using promises. In real life we could just move the ...