Skip to content

Instantly share code, notes, and snippets.

@maratori
maratori / golang-mocks.md
Last active May 6, 2024 09:59
Comparison of golang mocking libraries

Comparison of golang mocking libraries

Updated 2024-04-21

Uber
[gomock][6]
[testify][2] + [mockery][3] [minimock][4] [moq][5] Google
[gomock][1]

Library

GitHub stars [![s6]][6] [![s2]][2] + [![s3]][3] [![s4]][4] [![s5]][5] [![s1]][1]
Latest release date [![d6]][r6] [![d2]][r2] + [![d3]][r3] [![d4]][r4] [![d5]][r5] [![d1]][r1]
Maintained :white_check

Parse the kubernetes manifest in yaml or json, don't care a manifest type.

Examples:

package main

import (
	"bytes"
	"context"
@DzeryCZ
DzeryCZ / ReadingHelmResources.md
Last active May 8, 2024 19:31
Decoding Helm3 resources in secrets

Helm 3 is storing description of it's releases in secrets. You can simply find them via

$ kubectl get secrets
NAME                                                TYPE                                  DATA   AGE
sh.helm.release.v1.wordpress.v1                     helm.sh/release.v1                    1      1h

If you want to get more info about the secret, you can try to describe the secret

$ kubectl describe secret sh.helm.release.v1.wordpress.v1
@iamcryptoki
iamcryptoki / fix-sysctl.txt
Created July 29, 2019 09:20
Fix sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables.
$ modprobe bridge
$ echo "net.bridge.bridge-nf-call-iptables = 1" >> /etc/sysctl.conf
$ sysctl -p /etc/sysctl.conf
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such file or directory
# SOLUTION
$ modprobe br_netfilter
$ sysctl -p /etc/sysctl.conf
@Razer6
Razer6 / modelsim_installation.md
Last active May 7, 2024 16:19 — forked from robodhruv/modelsim_installation.md
Installing ModelSim on Ubuntu

ModelSim Installation on Ubuntu

Installation requirements

The free version of Modelsim is a 32-bit binary and therefore requires certain 32-bit libraries in order to work correctly. For Ubunutu, install the following packages

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32ncurses6 libxft2 libxft2:i386 libxext6 libxext6:i386 
@YumaInaura
YumaInaura / VIM.md
Last active April 16, 2024 22:17
Vim — What is the name of "q and colon" mode? ( A. command-line window )

Vim — What is the name of "q and colon" mode? ( A. command line window )

Or named "command window".

I mean "q and colon" ( q: ).

Not "colon and q" means quit vim ( :q ).

image

@martin056
martin056 / deep_transform.py
Created May 28, 2018 18:12
Deep snake_case and camelCase transformations
import re
from typing import Dict, Callable, Optional
def to_camel_case(snake_case_str: str) -> str:
"""
Transforms snake_case to camelCase
"""
components = snake_case_str.split('_')
titled_components = ''.join(x.title() for x in components[1:])
@mdonkers
mdonkers / server.py
Last active May 6, 2024 23:32
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@bradmontgomery
bradmontgomery / example.py
Created August 16, 2016 16:57
Example of setting a choices value for django ArrayField
# Here's your list of choices that would be displayed in a drop-down
# element on the web. It needs to be a tuple, and we define this
# as a variable just for readability/convenience.
#
# This example has 3 choices, each of which consists of two parts:
# 1. the thing that get strored in your database
# 2. the thing that you see in a dropdown list
LABEL_CHOICES = (
('this gets stored in your database', 'This item is what you see in the drop-down'),
('django', 'Django'),
@Rich-Harris
Rich-Harris / service-workers.md
Last active May 6, 2024 22:10
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.