Skip to content

Instantly share code, notes, and snippets.

View kiranpradeep's full-sized avatar

Kiran Pradeep kiranpradeep

View GitHub Profile

Base concept

For small projects, I usually instantiate every service (Dependencies) in one file, and when everything is up and running, we can start the server, and we can access everything. Like in this example (a python API from a high voltage wire designer app):

# Dependencies

wind_effect_calculator = WindEffectCalculator()
wind_pressure_calculator = WindPressureCalculator()
wire_density_calculator = WireDensityCalculator(CriticalStanchionDistanceCalculator())
wire_tension_calculator = WireTensionCalculator()
@ahmetgeymen
ahmetgeymen / bitbucket-pipelines.yml
Last active May 13, 2025 13:27
Bitbucket Pipelines: Build Docker Image + GCR Image Push + GKE Deploy
image: openjdk:11-jdk-slim
definitions:
caches:
gradlewrapper: ~/.gradle/wrapper
gke-kubectl-pipe: &pipe atlassian/google-gke-kubectl-run:1.3.1
gke-kubectl-pipe-variables: &pipe-variables
KEY_FILE: $GKE_API_KEYFILE
PROJECT: $GCP_PROJECT_ID
COMPUTE_ZONE: $GKE_COMPUTE_ZONE
@foreach (var item in new string[] { "AspNetCore","AspNet","SomeJsThingWhatever"})
{
<div>
<input type="radio" name="technology" id="@item" value="@item" @onchange="RadioSelection" checked=@(RadioValue.Equals(item,StringComparison.OrdinalIgnoreCase)) />
<label for="@item">@item</label>
</div>
}
<div>
<label>Selected Value is @RadioValue</label>
</div>
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active May 28, 2026 15:16
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Last update: Nov 2025.

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl ecparam -genkey -name secp384r1 | openssl ec -aes256 -out rootCA.key
@ph0b
ph0b / build.gradle
Last active February 12, 2023 07:45
sample build.gradle for generating split APKs per ABI
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig{
minSdkVersion 14
targetSdkVersion 21
versionCode 101
@yusukemihara
yusukemihara / curlpkcs11.c
Created August 1, 2014 02:21
perform HTTPS GET on ssl client verification using curl,OpenSSL ENGINE pkcs11 and libp11
#if 0
#!/bin/bash
src=$0
obj=${src%.*}
gcc -g -Wl,--no-as-needed `pkg-config --cflags --libs libcurl libssl libp11` -o $obj $src
exit
#endif
/* perform HTTPS GET on ssl client verification using curl,OpenSSL ENGINE pkcs11 and libp11
*
@vchernov
vchernov / timeval_add.cpp
Last active November 1, 2020 07:46
timeval arithmetic
// calculates addition of positive arguments
void add(const timeval& a, const timeval& b, timeval& result)
{
result.tv_sec = a.tv_sec + b.tv_sec;
result.tv_usec = a.tv_usec + b.tv_usec;
if (result.tv_usec >= 1000000)
{
result.tv_sec++;
result.tv_usec -= 1000000;
}
@mathieue
mathieue / udp-multi-socat.sh
Created August 28, 2012 23:57
udp multiplexer with socat
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140)