Skip to content

Instantly share code, notes, and snippets.

  • Print html found by cypress

    cy.get('li').invoke('html').then((val) => console.log(JSON.stringify(val)))

Thoughts on TDD

Why I like(d) it

  • It allows me make things in iteration

    It allows me to break things in components, test the component in isolation, and move on to the next component.

    Components have behaviors. They have algorithms.

apiVersion: v1
kind: Pod
metadata:
name: cli
spec:
containers:
- name: cli
image: busybox
command: ["tail", "-f", "/dev/null"]
volumeMounts:
@saadlu
saadlu / usefuloc.asciidoc
Last active December 1, 2021 15:16
useful kubectl/oc jsonpaths
  1. Print containers of a pod

    oc get pod <pod_name> -o jsonpath='{.spec.containers[*].name}{"\n"}' | tr ' ' '\n'
  2. IBM Chart repo URI

@saadlu
saadlu / gist:b778a79244b5023ab52f6a7886e01b8a
Created March 8, 2020 16:41
k8s/oc custom column examples
`oc get routes -o custom-columns=NAME:.metadata.name,HOST:.spec.host --all-namespaces`
@saadlu
saadlu / gist:9e783efa66d633dbe5d122c488f030c8
Last active December 28, 2018 16:03
What is ours/theirs - GREEN, PURPLE?
## Scenario
1. You have interactivelly gone back in time by `git rebase -i`
2. You have changed the commit
3. On continuing the rebase (with `git rebase --continue`), you will re-base the descentdant commits.
4. You get a conflict.
## What is the state?
You got a conflict rebasing a set of commits on your commit. The commit that is causing the conflict, is the "remote"
# Running web2.py accesible from host to a docker container
python web2py.py --nogui -a admin -i 0.0.0.0
# display all users in ubuntu
compgen -u
@saadlu
saadlu / gist:c4574d984453f936416ff9ac8cb0056b
Created December 11, 2017 16:17 — forked from madis/gist:4650014
Testing CORS OPTIONS request with curl
curl \
--verbose \
--request OPTIONS \
http://localhost:3001/api/configuration/visitor \
--header 'Origin: http://localhost:9292' \
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \
--header 'Access-Control-Request-Method: GET'
# http://nils-blum-oeste.net/cors-api-with-oauth2-authentication-using-rails-and-angularjs/#.UQJeLkp4ZyE
@saadlu
saadlu / gist:564dacf776ecc70d7e8486e4de36b209
Created December 6, 2017 15:22
Spring boot HATEOAS and HAL
If your spring boot uses
'org.springframework.hateoas:spring-hateoas`
dependency, to enable HAL with
`@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)`
you'd also need
@saadlu
saadlu / gist:6db6e3939db108178ca9992902e6edf4
Last active November 28, 2017 16:09
Kubernetes notes
== Kubernetes Cluster ==
- An abstraction that encapsulates containerised application
- The abstractions in Kubernetes allow you to deploy containerized applications to a cluster without tying them specifically to individual machines.
- A Kubernetes cluster consists of two types of resources
- The Master, coordinates the cluster
- Nodes are the workers that run applications