Skip to content

Instantly share code, notes, and snippets.

View prakashpandey's full-sized avatar
🎯
Focusing

Prakash prakashpandey

🎯
Focusing
View GitHub Profile
@prakashpandey
prakashpandey / ir-libreelec.md
Last active July 31, 2022 07:16 — forked from coaxial/ir-libreelec.md
How to setup an infrared remote on LibreELEC/Kodi on RPI

Libreelec setup notes

Connect IR Remote to Raspberry Pi 4

OS: Libreelec 10.02

Step 1

Enable lirc in Kodi

@prakashpandey
prakashpandey / rsa-pkcs.go
Created January 23, 2020 09:30 — forked from larryli/rsa-pkcs.go
RSA SignPKCS1v15 and VerifyPKCS1v15
// rsa-pkcs [-hash sha1] [-key id_rsa] -sign "foobar"
// rsa-pkcs [-hash sha1] [-pub id_rsa.pub] -verify "sign_data" "foobar"
package main
import (
_ "code.google.com/p/go.crypto/md4"
_ "code.google.com/p/go.crypto/ripemd160"
"crypto"
_ "crypto/md5"
@prakashpandey
prakashpandey / CustomResponseWriter.go
Last active March 19, 2024 21:34
Implement custom http.ResponseWriter in golang
package main
import (
"fmt"
"net/http"
)
type CustomResponseWriter struct {
body []byte
statusCode int
// Implement Geometry interface
func (r Rectangle) area() float32 {
return r.length * r.breadth
}
// Implement Geometry interface
func (r Rectangle) parameter() float32 {
return 2 * (r.length + r.breadth)
}
@prakashpandey
prakashpandey / define_type.go
Last active January 13, 2019 18:36
definetype in golang
// Rectangle struct implements Geometry and Color interface
type Rectangle struct {
length float32
breadth float32
color string
}
@prakashpandey
prakashpandey / define_interface.go
Created January 13, 2019 18:32
define interface in golang
// Geometry interface
type Geometry interface {
area() float32
parameter() float32
numOfSides() int
}
// Color interface
type Color interface {
getColor() string
@prakashpandey
prakashpandey / multiple_interfaces.go
Last active January 13, 2019 18:52
How to implement multiple interfaces in golang?
//
// Author: github.com/prakashpandey
//
// How interfaces works in golang using?
//
// In this sample program, our type 'Rectangle' will implement two interfaces
// - Type 'Rectangle' implements two interfaces:
// 1. Geometry
// 2. Color
// - To implement interfaces in golang, we don't have to do anything special,
/**
* Created by : fb.com/realprakashpandey on 24/8/16.
* About Program : Java implimentation of merge sort.
/
public class MergeSorts
{
/* @ int [] array : sample input for sorting, you can provide any list of number here */
static int[] array= {3, 35 ,4 ,85};