Skip to content

Instantly share code, notes, and snippets.

Avatar

Satwik Kansal satwikkansal

View GitHub Profile
@satwikkansal
satwikkansal / ems.sol
Last active October 22, 2022 07:30
Ethereum Smart contract for an Exam Management system written in solidity
View ems.sol
pragma solidity ^0.5.12;
contract Exam {
// The assessable element
// The Exam marking system which is responsible for invoking assessment functions.
address owner_ems;
address payable student;
// Main examiners
@satwikkansal
satwikkansal / cheatsheet.cpp
Last active September 9, 2022 05:25
C++ STL cheatsheet for competitive progrmming
View cheatsheet.cpp
/*
This a header file that includes every standard library.
You can use it to save time.
NOTE: This header file may not be recognized by compilers
other than gcc.
*/
#include <bits/stdc++.h>
/*
//Use this if the above header file doesn't work.
@satwikkansal
satwikkansal / quotefancy.py
Created May 3, 2017 07:55
Quotefancy wallpapers scraper
View quotefancy.py
import shutil
import os
import requests
from bs4 import BeautifulSoup
# USAGE: Add all the galleries that you want to be scraped in the list below
roots = ["https://quotefancy.com/motivational-quotes",
"https://quotefancy.com/inspirational-entrepreneurship-quotes",
"https://quotefancy.com/startup-quotes"]
@satwikkansal
satwikkansal / gan.py
Created June 19, 2018 18:36
Generative Adversarial Network implementation in Tensorflow for MNIST dataset: Generating handwritten digits using GANs
View gan.py
import tensorflow as tf
from PIL import Image
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
model_dir = './model/'
model_name = 'gan_mnist'
@satwikkansal
satwikkansal / BankingContract.sol
Last active November 11, 2020 07:30
Ethereum Smart Contracts written in Solidity for Crowdfunding
View BankingContract.sol
pragma solidity ^0.5.12;
/*
Ddescription:
Starting with the bank smart contract, create the notion of a next-of-kin address which gives names who can take control of the account if left inactive for 3 years.
▹ Add code to ensure that upon registering, a user must provide a next-of-kin address.
Hint: You will need a new table to store this.
▹ Add another table which stores when an account was last used (by calling register, deposit or payOut).
View test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View keybase.md

Keybase proof

I hereby claim:

  • I am satwikkansal on github.
  • I am satwikkansal (https://keybase.io/satwikkansal) on keybase.
  • I have a public key ASA-7f0t0AGsQ_56-_ofDR-c-vsF5qsdwT-_jFENkxM35wo

To claim this, I am signing this object:

@satwikkansal
satwikkansal / instructions.md
Created September 19, 2019 07:02
Steps for settting up Jupyter notebook for virtual environment in Python (2019 guide)
View instructions.md

Make sure you have jupyter installed and virtual envrionment set up already. I prefer virtualenv. If you don't have it set up, you can follow these steps,

$ pip install jupyter
$ pip install virtualenv
$ python -m virtualenv venv
$ source venv/bin/activate

Here, we've created virtual environment called venv and activated it.

@satwikkansal
satwikkansal / Simple Cricket API script
Last active May 27, 2019 13:02
Cheatsheet for Python
View Simple Cricket API script
#importing the python requests library
import requests
def get_scores():
url = "https://cricscore-api.appspot.com/csa"
#Creatin a GET request
response = requests.get(url)
@satwikkansal
satwikkansal / REPORT.md
Last active March 29, 2019 13:14
Work Report for Google Summer Of Code 2017
View REPORT.md
Orgainization [coala]
Project name Enhance coala-quickstart
Primary repository [coala-quickstart]
Project Mentors Adhityaa, Zatreanu Adrian-Gabriel
Project Page [Summer of Code Project Page]
Status Completed

Project Abstract