Skip to content

Instantly share code, notes, and snippets.


Satwik Kansal satwikkansal

View GitHub Profile
satwikkansal / snippet.cs
Created May 2, 2018
Creating persistent menu and get started button in C# (useful for
View snippet.cs
// Snippet for persistent menu
var client = new RestClient("");
var request = new RestRequest(Method.POST);
request.AddHeader("postman-token", "2f9a47e2-2a8a-0a70-c4ce-cb72dbfd8e93");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"setting_type\" : \"call_to_actions\",\n \"thread_state\" : \"existing_thread\",\n \"call_to_actions\":[\n {\n \"type\":\"postback\",\n \"title\":\"Help\",\n \"payload\":\"DEVELOPER_DEFINED_PAYLOAD_FOR_HELP\"\n },\n {\n \"type\":\"postback\",\n \"title\":\"Start a New Order\",\n \"payload\":\"DEVELOPER_DEFINED_PAYLOAD_FOR_START_ORDER\"\n },\n {\n \"type\":\"web_url\",\n \"title\":\"View Website\",\n \"url\":\"\"\n }\n ]\n }", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
satwikkansal /
Created Jun 19, 2018
Generative Adversarial Network implementation in Tensorflow for MNIST dataset: Generating handwritten digits using GANs
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 /
Created Sep 19, 2019
Steps for settting up Jupyter notebook for virtual environment in Python (2019 guide)

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.


Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

View test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
satwikkansal / BankingContract.sol
Last active Nov 11, 2020
Ethereum Smart Contracts written in Solidity for Crowdfunding
View BankingContract.sol
pragma solidity ^0.5.12;
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).
satwikkansal / ems.sol
Last active Nov 11, 2020
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