Skip to content

Instantly share code, notes, and snippets.

View Niraj-Fonseka's full-sized avatar
📚

Niraj Fonseka Niraj-Fonseka

📚
View GitHub Profile
import React, { useState, useEffect } from 'react';
import './App.css';
import { SensorRequest } from "./sensorpb/sensor_pb"
import { SensorClient} from "./sensorpb/sensor_grpc_web_pb"
var client = new SensorClient('http://localhost:8000')
function App() {
const [temp, setTemp] = useState(-9999);
import React, { useState, useEffect } from 'react';
import './App.css';
import { SensorRequest } from "./sensorpb/sensor_pb"
import { SensorClient} from "./sensorpb/sensor_grpc_web_pb"
var client = new SensorClient('http://localhost:8000')
function App() {
const [temp, setTemp] = useState(-9999);
const [humidity , setHumidity] = useState(-99999)
@Niraj-Fonseka
Niraj-Fonseka / I2C_LCD_driver.py
Created August 17, 2021 19:46
Python I2C library for Raspberry Pi
"""
Compiled, 2021 by Niraj Fonseka
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# original https://gist.github.com/DenisFromHR/cc863375a6e19dce359d by DenisFromHR
# 2021-08-16
"""
@Niraj-Fonseka
Niraj-Fonseka / new_ipykernel_to_vscode.md
Created May 21, 2022 19:19
adding custom python kernels for running jupyter notebooks on vscode
  • Create a new virtual env

    • virtualenv venv
  • Activate it

    • vtualenv venv/bin/activate
  • Install ipykernel

    • pip install ipykernel
  • Add the kernel to the list

@Niraj-Fonseka
Niraj-Fonseka / remove_slack_bot_from_channels.py
Created August 12, 2024 17:13
Remove a slack bot from all the channels it's added to
from slack_bolt import App
import time
app = App(token="")
resp = app.client.users_conversations()
channel_ids_to_skip = []