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
> deno run -A --unstable --node-modules-dir npm:next dev >> deno-err.log
warn - Invalid next.config.js options detected:
- The root value has an unexpected property, type, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
- The root value has an unexpected property, url, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, e
  1. Create empty array.
  2. Push random numbers to that array.
  3. Print the array.
  1. Assign a object to constant.
  2. Print keys and values of the object like below.
    key ~> value
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;
@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,
},
{
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)
apiVersion: v1
kind: Pod
metadata:
name: kubernetes-sri-lanka
labels:
app: rewind
version: 4
year: 2021
spec:
containers:
@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 () => {
@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 }
minikube stop