Skip to content

Instantly share code, notes, and snippets.

View vharsh's full-sized avatar
🔵
playing with Bluetooth

Harsh Vardhan vharsh

🔵
playing with Bluetooth
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculator</title>
<script>
function execute() {
console.log('some DOM event triggered this function call');
@vharsh
vharsh / keybase.md
Created March 12, 2022 06:35
Keybase verification

Keybase proof

I hereby claim:

  • I am vharsh on github.
  • I am vharsh (https://keybase.io/vharsh) on keybase.
  • I have a public key ASD3WSyw9cbjqe7besH_4wV34B6D6E8FOh6c8sjf0Iy-vAo

To claim this, I am signing this object:

import json
import requests
api = "https://api.github.com/repos"
url = input("The Repository URL: ")
repo = url.split('https://github.com')
tag_name = input("Tag name: ")
# Request a list of issues
print("REPO", repo)
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
cas.openebs.io/config: |
- name: StorageType
value: "device"
openebs.io/cas-type: local
creationTimestamp: "2020-04-27T10:19:33Z"
name: openebs-device
@vharsh
vharsh / metrics.txt
Created June 15, 2020 09:46
gist-2020-06-15T15:16Z.txt
## still connected clusters(external users only)
+------------+----------------------------+----------------------------------------+---------------------+-----------------------+------------------------+------------+--------------------------+------------------------+------------------------------------+-------------------------+
| cluster-id | cluster-name | cluster-uid | creation | k8s-version | last ping time | account-id | account-name | last login | user email | company name |
+------------+----------------------------+----------------------------------------+---------------------+-----------------------+------------------------+------------+--------------------------+------------------------+------------------------------------+-------------------------+
| 1981 | fulu-dev-s6kw6 | "a673d9a1-b109-11e8-b514-00155d012800" | 2019-02-20 09:17:06 | "v1.13.1"
// Good for a no nonsense file sharing across a network.
// This is an implementation of the similar functionality you get by doing `python -m SimpleHTTPServer`
// To use this you must compile this with a go compiler and pass the desired path to directory(to be hosted) as CLI arguments.
package main
import (
"net/http"
"os"
)
@vharsh
vharsh / pytest_pip_error_log
Created October 14, 2019 10:34
Python_pip tox test run
└─ $ ▶ tox -e py36 -- -n auto
GLOB sdist-make: /home/harsh/code/py/pypa/pip/setup.py
py36 inst-nodeps: /home/harsh/code/py/pypa/pip/.tox/.tmp/package/1/pip-19.3.dev0.zip
py36 installed: WARNING: Could not generate requirement for distribution -ip 19.3.dev0 (/home/harsh/code/py/pypa/pip/.tox/py36/lib/python3.6/site-packages): Parse error at "'-ip==19.'": Expected W:(abcd...),apipkg==1.5,atomicwrites==1.3.0,attrs==19.2.0,coverage==4.5.4,execnet==1.7.1,freezegun==0.3.12,importlib-metadata==0.23,mock==3.0.5,more-itertools==7.2.0,pip==19.3.dev0,pluggy==0.13.0,pretend==1.0.9,py==1.8.0,pytest==3.8.2,pytest-cov==2.8.1,pytest-forked==1.1.1,pytest-rerunfailures==6.0,pytest-timeout==1.3.3,pytest-xdist==1.27.0,python-dateutil==2.8.0,PyYAML==5.1.2,scripttest==1.3,setuptools==41.2.0,six==1.12.0,virtualenv==16.7.5,wheel==0.33.6,zipp==0.6.0
py36 run-test-pre: PYTHONHASHSEED='3832830226'
py36 run-test-pre: commands[0] | python -c 'import shutil, sys; shutil.rmtree(sys.argv[1], ignore_errors=True)' /home/harsh/code/py/pypa/pi
@vharsh
vharsh / health_test_not_mock.go
Last active December 6, 2018 13:16
health test mock
import (
"os"
"testing"
"time"
)
func TestGetPingPeriod(t *testing.T) {
beforeFunc := func(value string) {
if err := os.Setenv("OPENEBS_IO_ANALYTICS_PING_INTERVAL", value); err != nil {
t.Logf("Unable to set environment variable")
@vharsh
vharsh / ticks.go
Last active December 5, 2018 13:27
the 10 seconds tick
package main
import "time"
import "fmt"
func ticks() {
ticker := time.NewTicker(10 * time.Second)
for t := range ticker.C {
fmt.Println("Tick at", t)
@vharsh
vharsh / fileserver.go
Created May 3, 2018 08:40
Expose your directory's files over HTTP
// Good for a no nonsense file sharing across a network.
// This is an implementation of the similar functionality you get by doing `python -m SimpleHTTPServer`
// To use this you must compile this with a go compiler and pass the desired path to directory(to be hosted) as CLI arguments.
package main
import (
"net/http"
"os"
)