Skip to content

Instantly share code, notes, and snippets.

View sithumonline's full-sized avatar
🏠
Working from home

Sithum Bopitiya sithumonline

🏠
Working from home
View GitHub Profile
kubectl describe pod name-of-pod
kubectl get service
kubectl delete service name-of-service
minikube stop
@sithumonline
sithumonline / Readme.js
Created December 29, 2020 07:51
Z2H Markdown
// https://www.npmjs.com/package/marked
// yarn add marked
import marked from 'marked'
export default function ReadMeComponent(props) {
const getMarkdownText = () => {
var rawMarkup = marked(Data, { sanitize: true })
return { __html: rawMarkup }
@sithumonline
sithumonline / Metamask.jsx
Last active December 23, 2021 01:37
Fund transfer from Metamask account to another account
import { useState } from "react";
import { ethers } from "ethers";
export default function Metamask() {
const [myAddress, setMyAddress] = useState("");
const [toAddress, setToAddress] = useState();
const [amount, setAmount] = useState();
const [currency, setCurrency] = useState("USD");
const getExchangeRate = async () => {
apiVersion: v1
kind: Pod
metadata:
name: kubernetes-sri-lanka
labels:
app: rewind
version: 4
year: 2021
spec:
containers:
import cv2
import numpy as np
from cvzone.HandTrackingModule import HandDetector
import cvzone
cap = cv2.VideoCapture(0)
cap.set(3, 1920)
cap.set(4, 1080)
detector = HandDetector(detectionCon=0.8)
@sithumonline
sithumonline / in_between_values.js
Created February 19, 2022 11:45
Push object which fulfilling conditions
// yarn add lodash
let _ = require("lodash");
let ob = [
{
name: "John",
age: 30,
},
{
var maxParticleCount = 150; //set max confetti count
var particleSpeed = 2; //set the particle animation speed
var startConfetti; //call to start confetti animation
var stopConfetti; //call to stop adding confetti
var toggleConfetti; //call to start or stop the confetti animation depending on whether it's already running
var removeConfetti; //call to stop the confetti animation and remove all confetti immediately
(function() {
startConfetti = startConfettiInner;
stopConfetti = stopConfettiInner;