Skip to content

Instantly share code, notes, and snippets.

View debanshu's full-sized avatar

Debanshu Sinha debanshu

  • India
View GitHub Profile
@debanshu
debanshu / App.js
Created November 23, 2020 22:22
React Router Example
import React, { Component, useState } from "react";
import {
useLocation,
BrowserRouter,
Switch,
Route,
Link,
} from "react-router-dom";
import "../styles/App.css";
@debanshu
debanshu / Timer.js
Created November 17, 2020 13:06
Small App with Timer code
import React, { Component, useState } from "react";
import "../styles/App.css";
class App extends Component {
constructor(props) {
super(props);
this.state = {
time: new Date(),
};
this.intervalId = null;
@debanshu
debanshu / delete.js
Created May 7, 2020 13:11
Slack Email Files Deleter
/**
Since I had forwarded my emails to my slack email,
it started to fill up my slackbot channel.
This script is a very crude approach to deleting all the email files forwarded to me on slackbot.
Required since there's no bulk delete on Slack yet.
Needs the new Slack desktop UI to work.
Only runs in the currently active channel/conversation
@debanshu
debanshu / Assignment1.md
Created December 31, 2016 13:24
Assignment1 Cryptocurrency explanation by Felipe

Reproduced as is from Felipe Faria's post

The first thing you must do before starting the assignment is understanding the assignment. For obvious reasons I can't type here a "step-by-step procedure" of the assignment, but I can go over the classes and maybe clarify the instructions a bit better for you and anyone else having difficulties.

Your job for this assignment is to write the TxHandler class, which stands for Transactions Handler. This class has three functions in which you must write it yourself; TxHandler, isValidTx, and handleTxs. As the names suggest, one will initiate the class, one will verify the transactions, and the other will handle the transactions. Now I'm going to assume you have a basic understanding of Java, and you comprehend the idea of classes and functions.

These are the files given to us for the assignment:

Crypt
@debanshu
debanshu / pu_notifier.py
Created August 3, 2014 06:24
PU - XMPP Notification
#!/usr/bin/env python
'''
NOTES:
-----
This notifier can be used to alert latest changes on the PU wesite ,
udated at certain specified intervals.
The alerts can be sent from any xmpp account to any other xmpp account.
Currently gmail/gtalk/hangouts are ALSO supported (though they no longer have xmpp support).