Skip to content

Instantly share code, notes, and snippets.

@bendichter
bendichter / zarr_metadata.py
Last active July 4, 2024 15:52
Create zarr metadata to read arbitrary binary file
import numpy as np
import json
import base64
def _add_dataset_to_rfs(
rfs: dict,
shape: list[int],
dtype: np.dtype,
dset_name: str,
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
groups = ['citizenship', 'race', 'sex', 'institute', 'religion', 'occupation', 'first names', 'eye color']
# List of grouped people, e.g. [1 - iranian, 1 - italian, 4 - russians]
number_of_people = [[1, 1, 4], [1, 5], [1, 5], [1, 1, 4], [6], [1, 1, 4], [2, 1, 1, 1, 1], [2,2,2]]
# Total number of people
n_people = 6
@aaronmdjones
aaronmdjones / freenode-resign-letter.txt
Created May 19, 2021 10:20
My resignation from freenode
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
My resignation from freenode staff
==================================
I joined the freenode staff in March 2019 [1].
Before I joined the staff, Freenode Ltd was sold [2] to a person named
Andrew Lee as part of a sponsorship deal. The informal terms of that
<!DOCTYPE qgis_style>
<qgis_style version="2">
<symbols>
<symbol alpha="1" force_rhr="0" clip_to_extent="1" type="fill" name="pencilish">
<layer class="MarkerLine" pass="0" locked="0" enabled="1">
<prop k="average_angle_length" v="4"/>
<prop k="average_angle_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="average_angle_unit" v="MM"/>
<prop k="interval" v="0.02"/>
<prop k="interval_map_unit_scale" v="3x:0,0,0,0,0,0"/>
@tbl3rd
tbl3rd / naur.org
Created August 21, 2019 00:54
Programming as Theory Building, by Peter Naur

Programming as Theory Building, by Peter Naur

from Microprocessing and Microprogramming, Volume 15, Issue 5, May 1985, Pages 253-261.

Introduction

The present discussion is a contribution

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jfpuget
jfpuget / Julia_Python_perf.ipynb
Last active April 15, 2022 11:55
An exercise in Python optimization: make Python benchmarks as fast, if not faster, than Julia.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@atarkowska
atarkowska / curl_omero_web.sh
Created January 18, 2016 12:12
Log in to OMERO.web
#!/bin/bash
#
set -u
set -e
set -x
COOKIES=cookies.txt
LOGIN_URL=https://omero.host/prefix/webclient/login/
@athoune
athoune / pregexp.rb
Created December 9, 2015 22:10
Prefix index for massive regexp parsing, like Piwik does
require "set"
require 'regexp_parser'
require 'commons-collections4-4.1.jar'
module PreRegexp
def self.tokenize sentence
sentence.split(/[\s;()|]+/).sort.reverse
end