Skip to content

Instantly share code, notes, and snippets.

View dmadisetti's full-sized avatar
🇩🇲
Set status

Dylan Madisetti dmadisetti

🇩🇲
Set status
View GitHub Profile
@isentropic
isentropic / histogram2d.py
Last active January 7, 2022 13:50
Tensorflow histogram2d (Simple implementation)
import tensorflow as tf
@tf.function
def get2dHistogram(x, y,
value_range,
nbins=100,
dtype=tf.dtypes.int32):
"""
Bins x, y coordinates of points onto simple square 2d histogram
Given the tensor x and y:
@danbst
danbst / example.nix
Created April 8, 2017 07:07
Extending NixOS submodules
# this example adds an option `.tomcatProxy` in namespace
# services.nginx.virtualHosts.*.locations.*
# that acts as alternative to specifying actual nginx config in .extraConfig
#
# execute with
/*
cat $(grep -o "/nix/store/[a-z0-9]*-nginx.conf" \
$(NIX_PATH=nixos-config=./example.nix:$NIX_PATH \
nix-build --no-out-link -E '
with import <nixpkgs/nixos> {};
var express = require('express'),
request = require('request'),
BufferList = require('bufferlist').BufferList,
sys = require('sys');
var app = express.createServer(
express.logger(),
express.bodyDecoder()
);