Skip to content

Instantly share code, notes, and snippets.

View tamalsaha's full-sized avatar
🎢
Building. Learning. Improving.

Tamal Saha tamalsaha

🎢
Building. Learning. Improving.
View GitHub Profile
@tamalsaha
tamalsaha / appscode-individual-cla.txt
Created July 5, 2016 13:06
AppsCode Individual Contributor License Agreement
AppsCode Individual Contributor License Agreement
In order to clarify the intellectual property license granted with Contributions from any person or entity, AppsCode Inc. ("AppsCode") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of AppsCode; it does not change your rights to use your own Contributions for any other purpose.
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to AppsCode. Except for the license granted herein to AppsCode and recipients of software distributed by AppsCode, You reserve all right, title, and interest in and to Your Contributions.
Definitions.
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with AppsCode. For legal entities, the entity making a Contribution a
@tamalsaha
tamalsaha / appscode-corp-cla.txt
Created July 5, 2016 13:13
AppsCode Software Grant and Corporate Contributor License Agreement
AppsCode Software Grant and Corporate Contributor License Agreement
In order to clarify the intellectual property license granted with Contributions from any person or entity, AppsCode Inc. ("AppsCode") must have a Contributor License Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of AppsCode and its users; it does not change your rights to use your own Contributions for any other purpose.
This version of the Agreement allows an entity (the "Corporation") to submit Contributions to AppsCode, to authorize Contributions submitted by its designated employees to AppsCode, and to grant copyright and patent licenses thereto.
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to AppsCode. Except for the license granted herein to AppsCode and recipients of software distributed by AppsCode, You reserve all right
@tamalsaha
tamalsaha / check_module.py
Created December 21, 2016 01:57
Check if a python module is installed
# http://stackoverflow.com/a/14050282
def check_antipackage():
from sys import version_info
sys_version = version_info[:2]
found = True
if sys_version < (3, 0):
# 'python 2'
from pkgutil import find_loader
found = find_loader('antipackage') is not None
elif sys_version <= (3, 3):
@tamalsaha
tamalsaha / aes.java
Last active February 6, 2017 22:43
Jenkins Secret Parsing
package aes;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
@tamalsaha
tamalsaha / users.md
Created February 27, 2017 04:20 — forked from philips/users.md
Kubernetes Third-Party Resource Users

Please comment below if you are using Kubernetes Third-Party Resources and I will add you to the list.

Known Users:

@tamalsaha
tamalsaha / install-swagger-codegen.sh
Created March 23, 2017 17:59
Install swagger-codegen
wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.1.6/swagger-codegen-cli-2.1.6.jar -O /usr/local/share/swagger-codegen-cli.jar
cat >/usr/local/bin/swagger-codegen << EOF
#!/bin/sh
java -jar /usr/local/share/swagger-codegen-cli.jar "$@"
EOF
chmod +x /usr/local/bin/swagger-codegen
@tamalsaha
tamalsaha / translate.go
Created May 4, 2017 07:42 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@tamalsaha
tamalsaha / tpl1.go
Last active August 10, 2017 08:09
GO Template Example
package main
import (
"text/template"
"os"
)
func main() {
type Inner struct {
A string
}
type Outer struct {
@tamalsaha
tamalsaha / jsonpatch_arr.py
Created August 21, 2017 12:26
JsonPatch of Array
# https://python-json-patch.readthedocs.io/en/latest/tutorial.html#creating-a-patch
import jsonpatch
src = {
"spec": {
"loadBalancerSourceRanges": [
"192.101.0.0/16",
"192.0.0.0/24"
]
}