Skip to content

Instantly share code, notes, and snippets.

declare module 'datascript' {
type Db = string & {_opaque: typeof Db};
const Db: unique symbol;
type Conn = string & {_opaque: typeof Conn};
const Conn: unique symbol;
interface Iterable<T> {
next(): { value: null, done: true } | { value: T, done: false }
DeepEvaluated = int | float | str | "String" | None | dict[string, "Evaluated"] | list["Evaluated"] | Function
Evaluated = int | float | "String" | None | dict[string, "Value"] | list["Value"] | "Function"
T = TypeVar('T', bound=Evaluated)
class Value:
def __init__(self, x: Value | Evaluated | DeepEvaluated):
"""
Make a new Value from python
"""
# nix-build -E '((import <nixpkgs> {}).callPackage ./nix/onivim2.nix {})'
{ stdenv, lib, appimageTools, requireFile, autoPatchelfHook, makeWrapper, pango, cairo, gobject-introspection, glib, epoxy, libgpgerror, gdk-pixbuf, libxkbcommon, gtk3, ncurses5, acl, xorg, libGLU }:
stdenv.mkDerivation {
name = "Oni2";
version = "0.5.9-nightly";
dontStrip = true;
buildInputs = [
autoPatchelfHook
pango
cairo
with import <nixpkgs/lib>;
let
inherit (builtins) typeOf;
cfg = import ./router-config.nix;
indent = str:
let
parts = (splitString "\n" str);
plen = length parts;
in concatStringsSep "\n"
(imap0 (i: v: if (i == 0 || i == plen - 1) then v else " ${v}") parts);
{ stdenv, lib, fetchurl, appimageTools, electron_8, makeWrapper }:
stdenv.mkDerivation rec {
pname = "MQTT-Explorer";
version = "0.4.0-beta1";
src = appimageTools.extract {
name = pname;
src = fetchurl {
url = "https://github.com/thomasnordquist/${pname}/releases/download/0.0.0-${version}/${pname}-${version}.AppImage";
sha256 = "0x9ava13hn1nkk2kllh5ldi4b3hgmgwahk08sq48yljilgda4ppn";
{ stdenv, fetchFromGitHub, cmake, pkgconfig }:
let
inherit (stdenv.lib) optionals;
isCross = stdenv.buildPlatform != stdenv.hostPlatform;
in
stdenv.mkDerivation {
pname = "raspberrypi-armstubs";
version = "2020-10-08";
// code is MIT licensed etc etc copyright 2018 @puckipedia
// - dsmrv5 parser / @yorickvp
// -- Libraries used --
#pragma GCC diagnostic warning "-Wall"
#pragma GCC diagnostic warning "-Wextra"
// ESP8266 OTA
#include <ArduinoOTA.h>
// look I'm not going to pay for a signal inverter. hooray for software
#define INVERT_SERIAL
{ stdenvNoCC, fetchFromGitHub, telink-825x-sdk, tc32-gcc, python3 }:
stdenvNoCC.mkDerivation {
pname = "ATC_Thermometer";
version = "20201003";
src = "${fetchFromGitHub {
owner = "atc1441";
repo = "ATC_MiThermometer";
rev = "772348a2266ea22bd58795314be148a8154e6462";
sha256 = "05ggw0c61fbhw751c5icpv31i0cjk2nx5nmnkixid07ajsmhb7fw";
}}/ATC_Thermometer";
@yorickvP
yorickvP / tr1.txt
Last active September 20, 2020 10:32
[nix-shell:~]$ seq 1000 | perf stat -e r002c:u,r0225:u,r0425:u,r0825:u,r0e25:u sort > /dev/null
Performance counter stats for 'sort':
1 r002c:u
2 r0225:u
43 r0425:u
84 r0825:u
129 r0e25:u
@yorickvP
yorickvP / default.nix
Last active May 29, 2020 19:24
nix-reason-react-starter-build
let
pkgs = import <nixpkgs> {};
nix-npm-buildpackage = pkgs.callPackage (builtins.fetchTarball "https://github.com/yorickvp/nix-npm-buildpackage/archive/yorickvp/packageOverrides.tar.gz") {};
in
nix-npm-buildpackage.buildNpmPackage {
src = ./.;
installJavascript = false;
packageOverrides = {
bs-platform = pkgs.bs-platform;
};