Skip to content

Instantly share code, notes, and snippets.

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

Shobhit Chittora shobhitchittora

🏠
Working from home
View GitHub Profile
@shobhitchittora
shobhitchittora / commands.txt
Last active February 23, 2023 19:12
Mi tab Bloatware removal
cd C:\platform-tools\
./adb shell pm uninstall -k --user 0 com.miui.gallery
./adb shell pm uninstall -k --user 0 com.miui.calculator
./adb shell pm uninstall -k --user 0 com.xiaomi.calendar
./adb shell pm uninstall -k --user 0 com.miui.notes
./adb shell pm uninstall -k --user 0 com.miui.player
./adb shell pm uninstall -k --user 0 com.xiaomi.scanner
./adb shell pm uninstall -k --user 0 com.xiaomi.account
./adb shell pm uninstall -k --user 0 com.xiaomi.payment
@shobhitchittora
shobhitchittora / rfc-gql-error.md
Last active April 11, 2020 23:24
[RFC] Standard Error Codes

This RFC is an attempt to identify and standardize error codes for GraphQL errors. This has bee previously discussed, and some great work and ideas came out of it. Follow the previous discussion here - #698

Why standard error codes ?

Errors ( error codes ) are the silent guardians in the programming world. Though no one wants them in their code, they actually teach us a lot and mold our thinking process. This is especially true for statically typed compiled languages like c, rust etc, where the compiler scolds and guides the programmer to fix the program's syntax. A few strong argument for having a standard set of error codes for GraphQL can be -

  1. A well documented set of errors would help developers get a better understanding of the issues and errors during development.
  2. Potential suggestions to fix these errors would help developer productivity too.
  3. As the spec matures, this would force holistic system thinking and help catch outliers and p
@shobhitchittora
shobhitchittora / cancer.js
Last active December 15, 2019 20:32
Classification-Caner
const tf = require('@tensorflow/tfjs-node');
const TRAINING_DATA_URL = 'https://raw.githubusercontent.com/lmoroney/dlaicourse/master/TensorFlow%20Deployment/Course%201%20-%20TensorFlow-JS/Week%201/Exercise/wdbc-train.csv';
const TESTING_DATA_URL = 'https://raw.githubusercontent.com/lmoroney/dlaicourse/master/TensorFlow%20Deployment/Course%201%20-%20TensorFlow-JS/Week%201/Exercise/wdbc-test.csv';
async function run() {
// diagnosis column in the labelled csv
// has all the decisioning data
const trainingData = tf.data.csv(
TRAINING_DATA_URL, {
@shobhitchittora
shobhitchittora / event_loop.js
Last active October 21, 2018 07:49
Event Loop suedo-code
// my JS code
// node index.js
index.runCode();
// Node JS event loop
var pendingTimers = [];
var pendingOSTasks = [];
var pendingOperations = [];
const grpc = require('grpc');
const loader = require('@grpc/proto-loader');
const bindPath = '0.0.0.0:8080';
loader.load('todo.proto', { includeDirs: ['./src'] })
.then((packageDefinition) => {
const package = grpc.loadPackageDefinition(packageDefinition);
const Client = package.todo_app_package.TodoApp;
const client = new Client(bindPath, grpc.credentials.createInsecure());
const grpc = require('grpc');
const loader = require('@grpc/proto-loader');
const todos = require('./todos_db.json');
class TodoAppHandler {
getAll(_, callback) {
return callback(null, todos);
}
getTodo(call, callback) {
@shobhitchittora
shobhitchittora / todos_db.json
Created July 22, 2018 11:24
Todo App Json db
{
"todos": [
{
"id": 1,
"name": "Get eggs!",
"done": false
},
{
"id": 2,
"name": "Learn something new.",
@shobhitchittora
shobhitchittora / todo.proto
Created July 22, 2018 11:22
Protocol Buffer file for Todo App gRPC
/**
* Author - Shobhit Chittora
*/
syntax = "proto3";
package todo_app_package;
service TodoApp {
rpc getTodo (TodoId) returns (Todo) {}
@shobhitchittora
shobhitchittora / package.json
Last active July 22, 2018 11:08
initial project setup for gRPC tutorial
{
"name": "todo-app-grpc",
"version": "1.0.0",
"description": "A sample client and server to demonstrate use of gRPC with NodeJS.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start:server": "node src/server.js",
"start:client": "node src/client.js"
},
@shobhitchittora
shobhitchittora / person.proto
Created July 18, 2018 20:44
Protocol Buffers sample
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
enum PhoneType {
MOBILE = 0;
HOME = 1;
WORK = 2;
}