Skip to content

Instantly share code, notes, and snippets.

View nandanrao's full-sized avatar

Nandan Rao nandanrao

  • Barcelona, Spain
View GitHub Profile
import shapely
import geopandas as gpd
import pandas as pd
import shapely.geometry.polygon as ply
import xxhash
def add_geo(r, geo):
r = r.copy()
r['geometry'] = geo
return r
@nandanrao
nandanrao / values.yaml
Created June 20, 2021 21:52
Gitlab helm chart values for statefulset and deployment annotations for linkerd injection and mTLS in Gitlab
global:
deployment:
annotations:
linkerd.io/inject: enabled
gitlab:
gitaly:
annotations:
linkerd.io/inject: enabled
                          +---------------+
                          |               |              +-------------+
+---------------------->  |   typeform    | <----------+ |             |
|                         |               |              |  response   |
|                         +---------------+ +--------->  |  service    |
|                                                        |             |
|                                                        |             | +-----+
|                                                        +-------------+       |

| |

@nandanrao
nandanrao / questions.md
Last active May 27, 2021 07:32
question formats for vlab

Question types

Stitch

When stitching from one form to another, the "stitch" must be a statement:

YAML:

type: stitch
stitch:
/*!
* Marp / Marpit Gaia theme.
*
* @theme gaia
* @author Yuki Hattori
*
* @auto-scaling true
* @size 4:3 960px 720px
*/
/*!
* Marp / Marpit Gaia theme.
*
* @theme gaia
* @author Yuki Hattori
*
* @auto-scaling true
* @size 4:3 960px 720px
*/
/*!
* Marp / Marpit Gaia theme.
*
* @theme gaia
* @author Yuki Hattori
*
* @auto-scaling true
* @size 4:3 960px 720px
*/
/* $color-light: #F8F5EC; */
def foo(N):
for i in range(N):
print(i)
def square(a):
return a**2
square = lambda a: a**2
import numpy as np
from scipy.special import logsumexp
def _multi_mle(X, w):
X = X * w[:, np.newaxis]
return X.sum(axis=0) / X.sum()
def _multi_ll(X, params):
return X @ np.log(params).T
import numpy as np
def _multi_mle(X, w):
X = X * w[:, np.newaxis]
return X.sum(axis=0) / X.sum()
def _multi_ll(X, params):
return X @ np.log(params).T
def m_step(X, r):