Skip to content

Instantly share code, notes, and snippets.

View dramforever's full-sized avatar
🖤
dramming

dram dramforever

🖤
dramming
  • Scarlet Devil Mansion, Gensokyo
View GitHub Profile
@dramforever
dramforever / match_goal_forall.coq
Last active February 9, 2020 04:41
Coq: How do I match inside a binder properly?
Ltac detect :=
match goal with
| [ |- context G [ forall x : ?T, _ (* ?E *) ] ] =>
idtac G T; fail
end.
Theorem test : (forall x, x = 1) = (forall x, x = 2).
Proof.
try detect.
(* As shown above: _ matches inside binders expectedly
@dramforever
dramforever / register_file.hs
Created September 30, 2019 13:00
Attempt at register file
module Hs8b.Register where
import Clash.Prelude
type Reg = Unsigned 4
type Value = Unsigned 8
{-# ANN registerFileMono Synthesize
{ t_name = "register_file"
, t_inputs = PortName <$> words "clk rst write read"
@dramforever
dramforever / chisel-acc.scala
Last active September 10, 2019 13:40
Yosys the Verilog pretty printer?
class AccModule extends Module {
val io = IO(new Bundle{
val in = Input(UInt(32.W))
val out = Output(UInt(32.W))
})
val reg = RegInit(0.U(32.W))
reg := reg + io.in
io.out := reg
}
@dramforever
dramforever / log.txt
Created August 13, 2019 09:43
stack haddock log
clash-prelude > configure
clash-prelude > Configuring clash-prelude-0.9999...
clash-prelude > build
clash-prelude > Preprocessing library for clash-prelude-0.9999..
clash-prelude > Building library for clash-prelude-0.9999..
clash-prelude > [ 1 of 88] Compiling Clash.Annotations.BitRepresentation
clash-prelude > [ 2 of 88] Compiling Clash.Annotations.BitRepresentation.Internal
clash-prelude > [ 3 of 88] Compiling Clash.Annotations.BitRepresentation.Util
clash-prelude > [ 4 of 88] Compiling Clash.Annotations.Primitive
clash-prelude > [ 5 of 88] Compiling Clash.Annotations.SynthesisAttributes
@dramforever
dramforever / 0001-telegram-desktop-Fix-scaling.patch
Last active May 24, 2019 12:09
telegram-desktop: Fix UI scaling on Arch Linux
From 622543203c56845f5ad3e0f358b242736b33001e Mon Sep 17 00:00:00 2001
From: dramforever <[email protected]>
Date: Fri, 24 May 2019 20:06:31 +0800
Subject: [PATCH] Fix scaling
---
trunk/PKGBUILD | 2 +-
trunk/tdesktop.patch | 10 ----------
2 files changed, 1 insertion(+), 11 deletions(-)
@dramforever
dramforever / nodes.csv
Last active February 4, 2019 10:01
Sample channel closure for nixos-18.09-small
id name
144bdcxi3q7hfd431c6hsf1kiz4b35g1 postgresql-9.6.11-doc
150zivphs225rhlx18vjy273jwgnw8h8 cryptsetup-2.0.6-dev
1lf3m9rnim3rpa67cpf41vgdwy6f2qbl subversion-1.11.0-dev
1mw9g0cg2zv9rwf656hg8i2y0cvid3n2 linux-4.14.97-dev
2nc5zzraa57r2cj0gjpx1yhx5m9xyywj gettext-0.19.8.1-info
2r9qzfsnb2dzxcz4zwjk8qi5znr7z5jd nginx-1.14.1
2rg0q7xn3shffd48391jb8g3lmgpjmqm subversion-1.11.0-man
4iv1n45brycl3l4rdln4i4ah0yqlf05i python-2.7.15
4jxzmxaydpsf1h64kf1l075wy2vw09xv php-7.2.13-dev
@dramforever
dramforever / raiinn.cpp
Last active December 12, 2018 18:17
RAIINN (RAII Neural Network) (or maybe just the gradient part)
#include <iostream>
#include <memory>
#include <cmath>
struct Expr {
double grad, value;
void propagate(double delt) {
grad += delt;
}
Expr(double value_): value(value_) {}
# Based on https://gist.github.com/LnL7/570349866bb69467d0caf5cb175faa74
self: super:
{
dramPackages = (super.dramPackages or {}) // self.recurseIntoAttrs {
inherit (self)
chromium
# ... omitted
;