Skip to content

Instantly share code, notes, and snippets.

View suvayu's full-sized avatar

Suvayu Ali suvayu

View GitHub Profile
@suvayu
suvayu / draw-network.py
Created April 28, 2016 09:55
Draw a `Netwrok` using the `Cairo` backend of `graph-tool`
# coding=utf-8
"""This module lays out the LM network for DEL.
"""
from __future__ import print_function
from network.maps.ncr import DEL
from network.network import Network
@suvayu
suvayu / Deep_Learning_AMI_README.md
Created February 16, 2017 05:49
Deep Learning AMI README

Deep Learning Amazon Machine Image

The Deep Learning AMIs are prebuilt with popular Deep Learning frameworks and also contain the Anaconda Platform(Python2 and Python3).

Prebuilt Deep Learning Frameworks

  • MXNet: MXNet is a flexible, efficient, portable and scalable open source library for deep learning. It supports declarative and imperative programming models, across a wide
@suvayu
suvayu / bisq-proposal-upi.md
Last active July 19, 2018 22:38
Bisq proposal - UPI

Overview

All Indian banks support a peer-to-peer payment interface called Unified Payments Interface (UPI) on top of the Immediate Payment Service (IMPS) for national bank transfers. The remmitance is instantaneous, however each transaction is limited to a maximum of ₹100,000, which is approximately twice that of a typical middle class salary, and today 1 BTC is about ₹610,000.

@suvayu
suvayu / hidden_service.py
Last active July 19, 2018 22:50
Create an ephemeral Tor hidden service to expose a daemon running on localhost
#!/usr/bin/env python3
"""Create a TOR hidden service
$ ./hidden_service.py [port]
When no argument is provided, port defaults to 22. The script creates a hidden
service where 127.0.0.1:[port] is served over Tor. The onion address and
authentication cookie are printed on standard output. The private key and the
authentication cookie are saved in a pickle file (keys.pkl) to be reused on
subsequent runs.
@suvayu
suvayu / Makefile
Last active December 13, 2018 21:51
Gandiva filtering MWE for SO (https://stackoverflow.com/q/53750405/289784)
CC := $(shell which gcc)
CXX := $(shell which g++)
PKGCONFIG := $(shell which pkg-config)
CXXSTD := -std=c++17
OPTS := -g -Wall -m64 $(CXXSTD)
CXXFLAGS := $(OPTS) -pthread -fPIC $(shell $(PKGCONFIG) --cflags gandiva)
LDFLAGS := $(shell $(PKGCONFIG) --libs gandiva)
@suvayu
suvayu / myfuncs.py
Last active February 27, 2019 10:47
Logging to a package's logger
import logging
import dask
logger = logging.getLogger(__name__)
@dask.delayed
def times(arg, mult):
logger.info(f"Multiplying: {arg} * {mult}")
return arg * mult
@suvayu
suvayu / test.md
Last active March 19, 2019 09:55
Test Markdown heading achors

Top level heading

Some text

A sub-heading

Some text refering to another heading

Another sub-heading

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suvayu
suvayu / id-quirks.md
Created May 28, 2019 04:50
Quirks about `id`

Quirks about id

Integers

In [1]: a = 5
In [2]: b = a
In [3]: a is b
Out[3]: True
In [4]: c = 5

In [5]: a is c

@suvayu
suvayu / test_high_failures.py
Created July 25, 2019 06:25
Hypothesis generates large number of invalid examples
from datetime import datetime, time
import pytest
from hypothesis import given, assume, strategies as st
from hypothesis import settings, Verbosity
_cities = [f"city{i}" for i in range(4)]
_dt = st.shared(
st.datetimes(