Skip to content

Instantly share code, notes, and snippets.

@h9h
h9h / events.js
Created February 27, 2020 08:11
Minimal Event/Emitter Implementation
module.exports = () => ({
events: { },
emit(event, ...args) {
(this.events[event] || []).forEach(i => i(...args))
},
on(event, cb) {
(this.events[event] = this.events[event] || []).push(cb)
return () => (
this.events[event] = this.events[event].filter(i => i !== cb)
)
@h9h
h9h / environment.yml
Last active April 24, 2020 10:50
Lineare Algrebra
name: example-environment
channels:
- conda-forge
dependencies:
- numpy
- matplotlib
@h9h
h9h / environment.yml
Last active April 24, 2020 10:54
Bynder Notebook Template
name: example-environment
channels:
- conda-forge
dependencies:
- numpy
- psutil
- toolz
- matplotlib
- dill
- pandas
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: win-64
@EXPLICIT
https://conda.anaconda.org/conda-forge/win-64/ca-certificates-2020.4.5.1-hecc5488_0.tar.bz2
https://repo.anaconda.com/pkgs/main/win-64/icc_rt-2019.0.0-h0cc432a_1.conda
https://repo.anaconda.com/pkgs/main/win-64/intel-openmp-2020.0-166.conda
https://repo.anaconda.com/pkgs/msys2/win-64/msys2-conda-epoch-20160418-1.tar.bz2
https://conda.anaconda.org/conda-forge/win-64/pandoc-2.9.2.1-0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/poppler-data-0.4.9-1.tar.bz2
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: osx-64
@EXPLICIT
https://repo.anaconda.com/pkgs/main/osx-64/_tflow_select-2.3.0-mkl.conda
https://repo.anaconda.com/pkgs/main/osx-64/blas-1.0-mkl.conda
https://repo.anaconda.com/pkgs/main/osx-64/bzip2-1.0.8-h1de35cc_0.conda
https://repo.anaconda.com/pkgs/main/osx-64/c-ares-1.15.0-h1de35cc_1001.conda
https://repo.anaconda.com/pkgs/main/osx-64/ca-certificates-2020.1.1-0.conda
https://repo.anaconda.com/pkgs/main/osx-64/giflib-5.1.4-h1de35cc_1.conda
@h9h
h9h / note.cmd
Created June 30, 2020 06:46
Open Daily Journal-File in VS Code Insiders, create if not exists
@echo off
for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined MyDate set MyDate=%%x
for /f %%x in ('wmic path win32_localtime get /format:list ^| findstr "="') do set %%x
set fmonth=00%Month%
set fday=00%Day%
set today=%Year%-%fmonth:~-2%-%fday:~-2%
echo opening %today% in VS Code Insiders
set file=c:\Data\00-Temp\%today%.md
@h9h
h9h / Haskell-State-Example.hs
Last active December 28, 2021 17:20
Haskell State monad
tick :: State Int Int
tick = do
n <- get
put (n+1)
return n
{-
>>> tick
-}