Skip to content

Instantly share code, notes, and snippets.

@suhas316380
suhas316380 / gist:969620d95e111b9b34c7e1689ada722d
Last active May 7, 2024 19:57
awscli and kubectl cheatsheet for EKS

check EKS release

curl -s https://docs.aws.amazon.com/eks/latest/userguide/doc-history.rss | grep "<title>Kubernetes version"

Create EKS Cluster

eksctl create cluster --version=1.14 --name suhas-eks-test --region us-east-1 --zones us-east-1a,us-east-1b --node-type t2.medium --nodes 2 --ssh-access=true --ssh-public-key basarkod-test

Without any nodeGroup - Public

eksctl create cluster --without-nodegroup --version=1.14 --name delete-me --vpc-public-subnets=subnet-123,subnet-456

Without any nodeGroup - PRIVATE

@Klerith
Klerith / Dockerfile
Last active May 7, 2024 19:56
Preparar imagen de Docker - Node App
# Install dependencies only when needed
FROM node:18-alpine3.15 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
@bswck
bswck / im_done.md
Last active May 7, 2024 19:55
100% is not enough

Acing a recruitment task? Get ready to be rejected!

I'm done, guys. In April, I sent an application for a Fullstack Python Developer internship at Samsung R&D.
After (allegedly) reviewing my CV, they decided to invite me to a test assessing my technical skills:

invitation to test

Great! I indeed got the e-mail with the invitation link soon after: test link

@lantz
lantz / gist:5640610
Last active May 7, 2024 19:55
Script to set up NAT with Mininet
#!/usr/bin/python
"""
Example to create a Mininet topology and connect it to the internet via NAT
through eth0 on the host.
Glen Gibb, February 2011
(slight modifications by BL, 5/13)
"""
@m-jovanovic
m-jovanovic / .editorconfig
Created June 7, 2023 12:17
Sample editor config with a bunch of rules turned off 😅
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
@oscarmarina
oscarmarina / getScrollableParent.js
Last active May 7, 2024 19:49
Returns the scroll parent of an element along a specified axis and the scroll size and client size.
/**
* Returns the scroll parent of an element along a specified axis and the scroll size and client size.
*
* @param {HTMLElement} el - The element to find the scroll parent of.
* @param {String} [axis='y'] - The axis to find the scroll parent for.
* @returns {Object} An object with the following properties:
* @property {HTMLElement} scrollParent - The scroll parent element.
* @property {Number} scrollParentSize - The size of the scroll parent along the specified axis.
* @property {Number} clientParentSize - The size of the scroll parent's client area along the specified axis.
*/
@twxia
twxia / getScrollableParent.js
Created January 5, 2018 03:41
Get Scrollable Parent
function getScrollParent(node) {
const isElement = node instanceof HTMLElement;
const overflowY = isElement && window.getComputedStyle(node).overflowY;
const isScrollable = overflowY !== 'visible' && overflowY !== 'hidden';
if (!node) {
return null;
} else if (isScrollable && node.scrollHeight >= node.clientHeight) {
return node;
}
@huangzhichong
huangzhichong / selenium-webdriver-cheatsheet.md
Created August 7, 2012 12:38
Selenium Webdriver CheatSheet

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
import json
def annotation_testing(data):
counter_corrected = 0
counter_missing = 0
amount = 0
for d in data["data"]:
for p in d["paragraphs"]:
idx_remove = []
for i,q in enumerate(p["qas"]):
@thiamsantos
thiamsantos / db-conventions.md
Last active May 7, 2024 19:46
Convenções de nomenclatura para banco de dados

Convenções de nomenclatura para banco de dados

Geral

Os nomes das tabelas e colunas devem estar minúsculas e as palavras devem ser separadas por underscore, seguindo o padrão snake case. E todos os termos devem estar em inglês, exceto alguns termos que não há tradução apropriada para o inglês. Sempre prefira nomes descritivos, evitando ao máximo contrações.

Tabelas

Os nomes das tabelas devem estar no plural.