Skip to content

Instantly share code, notes, and snippets.

View P-A-R-U-S's full-sized avatar
💭
Building a dream...

Valentyn Ponomarenko P-A-R-U-S

💭
Building a dream...
View GitHub Profile
@P-A-R-U-S
P-A-R-U-S / PDBtoGAC.ps1
Created April 5, 2016 19:09
.NET: Copy PBD file to GAC ( Powershell script that copy all you PDB field to GAC)
#ODB Files Location
$binFolder = "C:\Projects\.net 2.0\build\bin"
$gacFolder = "%SYSTEMROOT%\Assembly\GAC_MSIL"
set-location $binFolder
$pdbfiles = get-childitem | where {$_.name.EndsWith("pdb")}
foreach ($pdb in $pdbfiles)
{
@P-A-R-U-S
P-A-R-U-S / Golang-IP-to-CIDR
Created March 16, 2018 22:53
Go: Convert IP to CIDR
/ Convert IPv4 range into CIDR
func iPv4RangeToCIDRRange(ipStart string, ipEnd string) (cidrs []string, err error) {
cidr2mask := []uint32{
0x00000000, 0x80000000, 0xC0000000,
0xE0000000, 0xF0000000, 0xF8000000,
0xFC000000, 0xFE000000, 0xFF000000,
0xFF800000, 0xFFC00000, 0xFFE00000,
0xFFF00000, 0xFFF80000, 0xFFFC0000,
0xFFFE0000, 0xFFFF0000, 0xFFFF8000,
@P-A-R-U-S
P-A-R-U-S / Golang-CIDR-to-IP
Created March 16, 2018 22:55
Go: Convert CIDR to IP
// Convert CIDR to IPv4 range
func CIDRRangeToIPv4Range(cidrs []string) (ipStart string, ipEnd string, err error) {
var ip uint32 // ip address
var ipS uint32 // Start IP address range
var ipE uint32 // End IP address range
for _, CIDR := range cidrs {
@P-A-R-U-S
P-A-R-U-S / Stack - Golang.go
Last active October 20, 2019 07:02
Stack implementation in Golang
// Following implemetation of Stack tie each element to it parent
type stackElement struct {
data interface{}
next *stackElement
}
type Stack struct {
Size int32
head *stackElement
@P-A-R-U-S
P-A-R-U-S / ReverseLinkedList.go
Created May 20, 2019 23:54
Reverse Linked List in Go/Golang
package Helpers
import (
"testing"
)
type Node struct {
data interface{}
prev *Node
}
@P-A-R-U-S
P-A-R-U-S / Sort Byte Array - Golang.go
Last active October 20, 2019 07:02
Sort Byte ([]byte) array in Go/Golang
b := []byte("9856743210")
fmt.Println("Before:", string(b))
sort.Slice(b, func(i, j int) bool {
return b[i] < b[j]
})
fmt.Println("After:", string(b))
@P-A-R-U-S
P-A-R-U-S / Queue - Golang.go
Last active October 20, 2019 07:02
Queue in Go/Golang
package Helpers
type Queue struct {
q []int32
}
func (q *Queue) push(v int32) {
q.q = append(q.q, v)
}
package DataStuctures
import (
"testing"
)
type MinHeap struct {
heap []int32
}
package DataStuctures
import (
"testing"
)
type MaxHeap struct {
heap []int
}
@P-A-R-U-S
P-A-R-U-S / Find_max_number_of_connected_colors_in_grid.go
Last active December 27, 2019 18:11
Find max number of connected colors in grid
package Google
import "testing"
// Find max number of connected colors in grid
// https://proglib.io/p/google-interview-task/?fbclid=IwAR2PXn_XqXQx97U3FLSFssVfDa1-m2P-T3yAJELEJoOWpNfcQjfyesOegpY
type si struct {
r int
c int