Skip to content

Instantly share code, notes, and snippets.

View sacOO7's full-sized avatar
🏠
Working from home

sachin shinde sacOO7

🏠
Working from home
View GitHub Profile
@sacOO7
sacOO7 / clientx.py
Created February 12, 2024 09:06 — forked from neilsh/clientx.py
Locust http2 client
# for HTTP/2 support in locust
# https://github.com/locustio/locust/issues/264
# https://gist.github.com/gawel/f48e577425f872e1a81028f3f53353cf#file-clientx-py
# has modifications to support breaking changes from locust 2.15.0
import re
import time
from locust import User
from locust.exception import LocustError
import httpx
@sacOO7
sacOO7 / i-miss-u.sh
Created July 8, 2020 19:00
Google chat failure notification
#!/bin/bash
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"cards\":[{\"header\":{\"title\":\"Oops. ${CIRCLE_JOB} failed.\",\"subtitle\":\"${CIRCLE_PROJECT_REPONAME}-${CIRCLE_BRANCH}\",\"imageUrl\":\"https://png.pngtree.com/svg/20170406/icon_failed__1325447.png\",\"imageStyle\":\"IMAGE\"},\"sections\":[{\"widgets\":[{\"keyValue\":{\"topLabel\":\"${CIRCLE_TAG}\",\"content\":\"Credits - ${CIRCLE_USERNAME}\"}}]},{\"widgets\":[{\"buttons\":[{\"textButton\":{\"text\":\"DETAILS\",\"onClick\":{\"openLink\":{\"url\":\"${CIRCLE_BUILD_URL}\"}}}}]}]}]}]}" \
"$CHAT_WEBHOOK_URL"
@sacOO7
sacOO7 / i-luv-you.sh
Created July 8, 2020 19:00
Google chat success notification
#!/bin/bash
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"cards\":[{\"header\":{\"title\":\"${CIRCLE_JOB} successful.\",\"subtitle\":\"${CIRCLE_PROJECT_REPONAME}-${CIRCLE_BRANCH}\",\"imageUrl\":\"https://png.pngtree.com/svg/20170510/success_404253.png\",\"imageStyle\":\"IMAGE\"},\"sections\":[{\"widgets\":[{\"keyValue\":{\"topLabel\":\"${CIRCLE_TAG}\",\"content\":\"Credits - ${CIRCLE_USERNAME}\"}}]},{\"widgets\":[{\"buttons\":[{\"textButton\":{\"text\":\"DETAILS\",\"onClick\":{\"openLink\":{\"url\":\"${CIRCLE_BUILD_URL}\"}}}}]}]}]}]}" \
"$CHAT_WEBHOOK_URL"
@sacOO7
sacOO7 / CoinigyScApi.swift
Created May 21, 2018 19:42
Coinigy API client implementation in Swift using Socketcluster swift client (https://github.com/sacOO7/socketcluster-client-swift)
// This is a console swift application to connect conigy api, please replace api keys with your own coinigy credentials
@sacOO7
sacOO7 / CoinigyScApi.go
Last active July 19, 2018 18:31
Coinigy API client implementation in Golang using Socketcluster go client (https://github.com/sacOO7/socketcluster-client-go)
// This is a console go application to connect conigy api, please replace api keys with your own coinigy credentials
package main
import (
"github.com/sacOO7/socketcluster-client-go/scclient"
"text/scanner"
"os"
"fmt"
"reflect"
@sacOO7
sacOO7 / CoinigyScApi.cs
Created May 21, 2018 19:27
Coinigy API client implementation in .NET using Socketcluster c# client (https://github.com/sacOO7/SocketclusterClientDotNet)
// This is a console C# application to connect conigy api, please replace api keys with your own coinigy credentials
@sacOO7
sacOO7 / CoinigyScApi.py
Last active September 3, 2018 19:43
Coinigy API client implementation in python using Socketcluster python client (https://github.com/sacOO7/socketcluster-client-python)
# This is a console python application to connect conigy api, please replace api keys with your own coinigy credentials
from socketclusterclient import Socketcluster
import json
import logging
api_credentials = json.loads('{}')
api_credentials["apiKey"]="xxx"
@sacOO7
sacOO7 / CoinigyScApi.java
Last active July 16, 2018 19:12
Coinigy API client implementation in java using Socketcluster java client (https://github.com/sacOO7/socketcluster-client-java)
// This is a console java application to connect conigy api, please replace api keys with your own coinigy credentials
import com.neovisionaries.ws.client.WebSocketException;
import com.neovisionaries.ws.client.WebSocketFrame;
import io.github.sac.Ack;
import io.github.sac.BasicListener;
import io.github.sac.Emitter;
import io.github.sac.Socket;
import java.util.List;
@sacOO7
sacOO7 / echo_websocket.go
Last active April 1, 2018 19:05
Go websocket client example
//echo_websocket.go
package main
import (
"log"
"github.com/sacOO7/gowebsocket"
"os"
"os/signal"
)
@sacOO7
sacOO7 / AtomicInteger.swift
Created January 6, 2018 20:18 — forked from nestserau/AtomicInteger.swift
Atomic way to operate on integers in Swift. Inspired by Java's AtomicInteger
/// This is free and unencumbered software released into the public domain.
///
/// Anyone is free to copy, modify, publish, use, compile, sell, or
/// distribute this software, either in source code form or as a compiled
/// binary, for any purpose, commercial or non-commercial, and by any
/// means.
///
/// In jurisdictions that recognize copyright laws, the author or authors
/// of this software dedicate any and all copyright interest in the
/// software to the public domain. We make this dedication for the benefit