Skip to content

Instantly share code, notes, and snippets.

@jaybutera
jaybutera / nix-install-ircd.md
Last active August 5, 2022 09:11
How to install and run darkfi ircd using Nix

To connect to the darkfi irc you need to run a local node which will participate in the p2p protocol.

This method of installation is more beginner friendly. There are very few commands and not many ways things can go wrong.

Install Nix Package Manager

Nix is a special package manager which will build the ircd and all dependencies. It's just a one-line install on a terminal.

On Linux: https://nixos.org/download.html

On MacOS: https://wickedchicken.github.io/post/macos-nix-setup/

@jaybutera
jaybutera / shell.nix
Created August 6, 2020 18:56
Nix shell for Libp2p dependencies
with import <nixpkgs> {};
let
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
pkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
myrust = ((pkgs.rustChannelOf { date = "2020-07-01"; channel = "nightly"; }).rust.override { extensions = [ "rust-src" "rust-analysis" "rustfmt-preview" ]; targets = [ "wasm32-unknown-unknown" ]; });
in
pkgs.mkShell {
buildInputs = [
myrust openssl pkgconfig cmake python3 llvmPackages.clang-unwrapped gnuplot libbfd libopcodes libunwind autoconf automake libtool rsync yarn nodejs nodePackages.typescript
];

Keybase proof

I hereby claim:

  • I am jaybutera on github.
  • I am jaybutera (https://keybase.io/jaybutera) on keybase.
  • I have a public key ASBE76SY6N3rTpBZHBoEnjHe-8ueZ_69ba_DBN-9-SsTewo

To claim this, I am signing this object:

pub enum Column<T> {
ColumnVec { items: Vec<T> },
ColumnMap { items: HashMap<String,T> },
}
struct ColumnIter<'a, T> {
iter: Box<dyn Iterator<Item=&'a T>>,
}
impl<T> Column<T> {
// Copyright 2018 Parity Technologies (UK) Ltd.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
struct BST {
l: Option< Box<BST> >,
r: Option< Box<BST> >,
v: i32,
}
impl BST {
fn new(x: i32) -> Self {
BST { l: None, r: None, v:x }
}
extern crate tokio;
use tokio::prelude::*;
use tokio::io::copy;
use tokio::net::TcpListener;
use std::sync::{Arc,Mutex};
struct Entity;
fn main() {
@jaybutera
jaybutera / ga.hs
Last active August 3, 2018 01:47
Genetic Algorithm
import System.Random
type Genome = [Bool]
mutate :: Genome -> Genome
mutate g = take (length g - 1) g ++ [True]
fitness :: Genome -> Int
fitness [] = 0
fitness g
// Bogosort cohort
// 4341 Sec 501
// Problem 2
//
// No-nonsense d-type flipflop
module FlipFlop(clk, in, out);
parameter n=1;
input clk; // Clock
input [n-1:0] in;
<% if current_user %>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<p id="notice"><%= notice %></p>
<div class = "container-fluid">
<div class = "row">
<div class = "col-md-4 col-md-offset-4">
<div class = "panel panel-info">