Skip to content

Instantly share code, notes, and snippets.

View amirphl's full-sized avatar
🎯
Focusing

Amir M Pirhosseinloo amirphl

🎯
Focusing
View GitHub Profile
https://dev.deluge-torrent.org/wiki/UserGuide/ThinClient
https://deluge.readthedocs.io/en/latest/how-to/systemd-service.html
https://forum.deluge-torrent.org/viewtopic.php?f=9&t=49679
@amirphl
amirphl / add-two-numbers.go
Last active October 20, 2023 14:29
Interview question + solution
/*
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order,
and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You may assume the two numbers do not contain any leading zero, except the number 0 itself.
Example 1:
Input: l1 = [2,4,3], l2 = [5,6,4]
Output: [7,0,8]
Explanation: 342 + 465 = 807.
@amirphl
amirphl / interview-problem.go
Last active October 21, 2023 23:01
Interview question
/*
We have a list of destinations (cells) and a list of agents. We want to find the closest agent-destination pair. If multiple pairs are found, we choose the agent with the lower priority. Then, the agent walks to the destination and the destination is removed from the list of destinations. The agent then becomes free.
We want to assign agents to destinations as soon as possible. We can model this problem in Go as follows:
*/
package main
import (
"fmt"
"sort"
@amirphl
amirphl / go-first
Last active October 15, 2022 11:50
Most recommended libs, frameworks, practices, design, ...
Golang:
- https://github.com/avelino/awesome-go
- https://github.com/tmrts/go-patterns
- https://github.com/quii/learn-go-with-tests
- https://github.com/inancgumus/learngo
- https://github.com/Alikhll/golang-developer-roadmap
- https://github.com/hoanhan101/ultimate-go
- https://github.com/dariubs/GoBooks
- https://golang.org/ref/mod
- https://github.com/geektutu/7days-golang
@amirphl
amirphl / editor.md
Last active May 19, 2023 09:03
make vim a good editor for Golang and Scala

To switch back between Golang and Scala: init.vim and init.lua

Golang

I followd the guide provided by this guy (https://octetz.com/docs/2019/2019-04-24-vim-as-a-go-ide/) and faced some problems:

  • The vim.plug should be copied inside ~/.config/nvim/autoload/ not ~/.var/app/io.neovim.nvim/data/nvim/site/autoload/.
  • The command :GoInstallBinaries installs the binaries like gopls (in my case) inside $HOME/go/bin. Therefore, $HOME/go/bin must be appended to the $PATH variable.
if [ -d "$HOME/go/bin" ] ; then
 PATH="$PATH:$HOME/go/bin"