Skip to content

Instantly share code, notes, and snippets.

View rabingaire's full-sized avatar
🇳🇵
Let everything happen

rabin rabingaire

🇳🇵
Let everything happen
View GitHub Profile
@rabingaire
rabingaire / Example.hs
Created April 6, 2022 11:12
Haskell Typeclasses Example
data Coord = Coord Integer Integer
-- instance Eq Coord where
-- (==) (Coord x1 y1) (Coord x2 y2) = x1 == x2 && y1 == y2
instance Show Coord where
show (Coord x y) = "(" ++ show x ++ "," ++ show y ++ ")"
-- instance Eq Coord where
-- (==) c1 c2 = x1 == x2 && y1 == y2
-- where
@rabingaire
rabingaire / postman-script.js
Last active August 14, 2020 05:01
Postman accesss token & refresh token get automation script
const url = `${pm.environment.get("base_url")}/signin`;
const email = pm.environment.get("email");
const password = pm.environment.get("password");
const postRequest = {
url: url,
method: "POST",
header: "Content-Type:application/json",
body: {
mode: "application/json",
## Run Test Suite inside docker
tests:
@docker-compose -f docker-compose.yml up --build --abort-on-container-exit
@docker-compose -f docker-compose.yml down --volumes
## Run Integration Test
## Note: This command is intended to be executed within docker env
integration-tests:
@sh -c "while ! curl -s http://rabbitmq:15672 > /dev/null; do echo waiting for 3s; sleep 3; done"
go test -v ./...
version: "3"
networks:
queue-test:
driver: bridge
services:
tests:
container_name: "tests"
build:
context: .
depends_on:
FROM golang:alpine
RUN apk add --no-cache make curl gcc libc-dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
package rabbitmq
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)
// Define the custom testify suite
package rabbitmq
import "github.com/streadway/amqp"
// Config parameters for queue service
type Config struct {
URL string
Exchange string
QueueName string
RoutingKey string
@rabingaire
rabingaire / lldb-sourcekit.log
Created August 28, 2019 17:38
lldb-sourcekit log
AOCRT::NPI: Found all the non-indexed ISA masks
AOCRT::NPI: Found all the indexed ISA masks
SwiftASTContextForExpressions::SetTriple("x86_64h-apple-macosx") setting to "x86_64-apple-macosx10.14.4"
SwiftASTContextForExpressions::CreateInstance(Target)
SwiftASTContext("dyld")::SetTriple("x86_64-apple-macosx10.14.0") setting to "x86_64-apple-macosx10.14.0"
SwiftASTContext("libcache.dylib")::SetTriple("x86_64-apple-macosx10.14.0") setting to "x86_64-apple-macosx10.14.0"
SwiftASTContext("repl_swift")::SetTriple("x86_64-apple-macosx10.14.4") setting to "x86_64-apple-macosx10.14.4"
SwiftASTContext("repl_swift")::SetTriple("x86_64-apple-macosx10.14.4") setting to "x86_64-apple-macosx10.14.4"
SwiftASTContext("libSystem.B.dylib")::SetTriple("x86_64-apple-macosx10.14.0") setting to "x86_64-apple-macosx10.14.0"
SwiftASTContext("libSystem.B.dylib")::SetTriple("x86_64-apple-macosx10.14.0") setting to "x86_64-apple-macosx10.14.0"
@rabingaire
rabingaire / main.go
Created August 23, 2019 11:48
text2go: Converts .txt file to .go file
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
)
func main() {
@rabingaire
rabingaire / main.go
Created August 23, 2019 06:59
CSV Extractor: Reads CSV file and creates a sub CSV file given start row and end row
package main
import (
"encoding/csv"
"log"
"os"
"strconv"
)
func main() {