- TS application listening port: 7777
|-- dist
|-- src
|-- .dockerignore
|-- Dockerfile
| package cache | |
| import ( | |
| "sync" | |
| "time" | |
| ) | |
| // Cache is a basic in-memory key-value cache implementation. | |
| type Cache[K comparable, V any] struct { | |
| items map[K]V // The map storing key-value pairs. |
| const express = require('express'); | |
| const app = express(); | |
| // Application | |
| app.get('/', function(req, res) { | |
| if (process.env.NODE_ENV === 'development') { | |
| for (var key in require.cache) { | |
| delete require.cache[key]; | |
| } | |
| } |
| // This gist is for my YouTube video which I tried to explain Window Sliding Technique. | |
| // You can watch it from here: https://youtu.be/guDU5HnLqAs | |
| // Given a sorted array A (sorted in ascending order), having N integers, | |
| // find if there exists any pair of elements (A[i], A[j]) such that | |
| // their sum is equal to X. | |
| // | |
| // Input: A = [2,3,4,5,6,7,8,9], k= 10 | |
| // Output: true | |
| // NOTE: We slightly changed the question and the output in the video. We're returning pair indexes as an array. |
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
| package main | |
| import "fmt" | |
| /* | |
| Return all permutations of a string | |
| Example, | |
| Find all perm of abc: |
| #add 'node_modules' to .gitignore file | |
| git rm -r --cached node_modules | |
| git commit -m 'Remove the now ignored directory node_modules' | |
| git push origin <branch-name> |
| package main | |
| import "fmt" | |
| func uniqueNonEmptyElementsOf(s []string) []string { | |
| unique := make(map[string]bool, len(s)) | |
| us := make([]string, len(unique)) | |
| for _, elem := range s { | |
| if len(elem) != 0 { | |
| if !unique[elem] { |