Skip to content

Instantly share code, notes, and snippets.


Krishnan Srinivasan krishpop

View GitHub Profile
bajcmartinez / erc20-token-sample.sol
Last active Apr 12, 2021
Necessary code to generate an ERC20 Token
View erc20-token-sample.sol
pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// Sample token contract
// Symbol : LCST
// Name : LCS Token
// Total supply : 100000
// Decimals : 2
// Owner Account : 0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe
Willian-Zhang /
Last active Feb 2, 2020 — forked from pavelmalik/
Install Tensorflow 1.7 on macOS High Sierra 10.13.4 with CUDA and stock python

Tensorflow 1.7 with CUDA on macOS High Sierra 10.13.4 for eGPU

Largely based on the Tensorflow 1.6 gist, and Tensorflow 1.7 gist for xcode, this should hopefully simplify things a bit.


  • NVIDIA Web-Drivers 387. for 10.13.4
  • CUDA-Drivers 387.178
  • CUDA 9.1 Toolkit
brenopolanski /
Created Dec 26, 2017
Exporting an object as svg from inkscape
  1. Select the object(s) to export
  2. Open the document properties window (Ctrl+Shift+D)
  3. Select "Resize page to drawing or selection"
  4. File > Save As Copy...
  5. Select Optimized SVG as the format if you want to use it on the web
sammchardy / binance-depth-cache-notes.txt
Last active Nov 22, 2020
Binance Depth Cache Notes
View binance-depth-cache-notes.txt
Ninj0r admin, [Oct 20, 2017, 9:18:55 AM]:
It's a three step process:
1) Start listening to the stream and buffering the messages
2) Get a depth snapshot
3) replay the buffered messages and the live messges.
Depth updates have two variables, u and U
U is the initial updateId, and u is the final updateId. There can be multiple updates "compressed" into a single update that comes out via the web socket stream.
jovianlin /
Created Oct 3, 2016
Get List of Devices in TensorFlow
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [ for x in local_device_protos if x.device_type == 'GPU']
# Working example for my blog post at:
import functools
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def doublewrap(function):
A decorator decorator, allowing to use the decorator to be used without
devStepsize /
Last active Apr 5, 2021
POST a JSON payload to a Slack Incoming Webhook using Python requests
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
import json
import requests
TSiege / The Technical Interview Cheat
Last active Apr 12, 2021
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat


I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!


iamatypeofwalrus /
Last active Mar 5, 2021
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.


Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
gnarmis /
Created Jan 27, 2013
min max heap implementation in python
from math import log, floor, pow
class MinMaxHeap(object):
"""an implementation of min-max heap using an array,
which starts at 1 (ignores 0th element)
def __init__(self, array=[]):
super(MinMaxHeap, self).__init__()