Skip to content

Instantly share code, notes, and snippets.

Avatar

Velotio Technologies velotiotech

View GitHub Profile
View react-component-with-nodes.jsx
function App() { // App
return (
<div className="wrapper"> // W
<div className="list"> // L
<div className="list_item">List item A</div> // LA
<div className="list_item">List item B</div> // LB
</div>
<div className="section"> // S
<button>Add</button> // SB
<span>No. of items: 2</span> // SS
View React-Fiber-type-defs.ts
export type Fiber = {
// Tag identifying the type of fiber.
tag: TypeOfWork,
// Unique identifier of this child.
key: null | string,
// The value of element.type which is used to preserve the identity during
// reconciliation of this child.
elementType: any,
View gist:26880a88f350aca25a713b02acfa7a31
function App() {
return (
<div className="wrapper">
<div className="list">
<div className="list_item">List item A</div>
<div className="list_item">List item B</div>
</div>
<div className="section">
<button>Add</button>
<span>No. of items: 2</span>
View request-idle-callback.js
function lowPriorityWork(deadline) {
while (deadline.timeRemaining() > 0 && workList.length > 0)
performUnitOfWork();
if (workList.length > 0)
requestIdleCallback(lowPriorityWork);
}
View selective-scaling-vpa.yaml
spec:
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: autoscale-tester
updatePolicy:
updateMode: "Auto"
resourcePolicy:
containerPolicies:
- containerName: autoscale-tester
View describe-vpa-stress-load.sh
kubectl describe vpa autoscale-tester-recommender
Name: autoscale-tester-recommender
Namespace: autoscale-tester
...
Recommendation:
Container Recommendations:
Container Name: autoscale-tester
Lower Bound:
Cpu: 500m
Memory: 500Mi
View stress-load-top.sh
kubectl top po
NAME CPU(cores) MEMORY(bytes)
autoscale-tester-5d6b48d64f-5dlb7 1000m 1836Mi
autoscale-tester-5d6b48d64f-9wq4w 252m 501Mi
autoscale-tester-5d6b48d64f-qrlxn 252m 501Mi
View autoscale-tester-rescaled.sh
kubectl get po
NAME READY STATUS RESTARTS AGE
autoscale-tester-5d6b48d64f-5dlb7 1/1 Running 0 77s
autoscale-tester-5d6b48d64f-9wq4w 1/1 Running 0 37s
autoscale-tester-5d6b48d64f-qrlxn 1/1 Running 0 17s
kubectl describe po autoscale-tester-5d6b48d64f-5dlb7
Name: autoscale-tester-5d6b48d64f-5dlb7
Namespace: autoscale-tester
View vpa-updater-warning.sh
1 pods_eviction_restriction.go:209] too few replicas for ReplicaSet autoscale-tester/autoscale-tester1-7698974f6. Found 1 live pods
You can’t perform that action at this time.