Skip to content

Instantly share code, notes, and snippets.

View yoshuawuyts's full-sized avatar

Yosh yoshuawuyts

View GitHub Profile
{ config, pkgs, ... }:
let
hostname = "luz3";
in {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# I use VirtualBox to connect to Windows and Linux guests
@yoshuawuyts
yoshuawuyts / Q&A.md
Created March 16, 2016 05:58 — forked from novaluke/0-Q&A.md
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

@yoshuawuyts
yoshuawuyts / tracing_log.rs
Created June 29, 2020 19:11 — forked from KodrAus/tracing_log.rs
Converting between `tracing` key values and `log` key values
use std::fmt;
use log::kv::{self, Source, value::{self, Fill}};
use tracing::{Value, Field, field::{self, Visit}};
#[doc(hidden)]
pub struct LogField<'kvs>(&'kvs Field, &'kvs dyn Value);
impl fmt::Debug for LogField<'_> {
@yoshuawuyts
yoshuawuyts / arch-linux-install.md
Created May 19, 2019 21:57 — forked from jamesmunns/arch-linux-install.md
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
@yoshuawuyts
yoshuawuyts / playground.rs
Created September 16, 2019 02:59 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#[derive(Debug, PartialEq)]
enum State {
Waiting { waiting_time: usize },
Filling { rate: usize },
Done,
Failure(String),
}
#[derive(Debug, Clone, Copy)]
enum Event {
@yoshuawuyts
yoshuawuyts / playground.rs
Created September 2, 2019 18:42 — forked from rust-play/playground.rs
Code shared from the Rust Playground
macro_rules! fmt_args {
($($tt:tt)*) => {
_fmt_args_!("",; $($tt)*)
};
}
macro_rules! _fmt_args_ {
($fmt:expr, $($args:expr,)*; ) => {
format_args!($fmt $(,$args)*)
};
@yoshuawuyts
yoshuawuyts / kv-log-macro.rs
Last active September 1, 2019 12:06 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#[macro_export]
macro_rules! info {
// info!("...")
($e:expr) => {
$crate::info_impl!(($e));
};
// info!("...", args...)
($e:expr, $($rest:tt)*) => {
$crate::info_impl!(($e) $($rest)*);
@yoshuawuyts
yoshuawuyts / playground.rs
Created July 22, 2019 21:30 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#![feature(async_await)]
use std::{cell::Cell, future::Future, io, net::SocketAddr, pin::Pin};
pub trait TcpStream {}
impl<T: TcpStream + ?Sized> TcpStream for Pin<Box<T>> {}
pub trait Runtime: Send + Sync + 'static {
type TcpStream: TcpStream;
@yoshuawuyts
yoshuawuyts / playground.rs
Created July 22, 2019 21:26 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#![feature(async_await)]
use std::{cell::Cell, future::Future, io, net::SocketAddr, pin::Pin};
pub trait TcpStream {}
impl<T: TcpStream + ?Sized> TcpStream for Pin<Box<T>> {}
pub trait Runtime: Send + Sync + 'static {
type TcpStream: TcpStream;
machine:
node:
version: 0.10.35
dependencies:
pre:
- sudo apt-get install -y libpoppler-glib-dev libpoppler-glib8 libcairo2-dev libcairo2
- sudo apt-get install -y libpq-dev
database:
override:
- psql -c 'create database test;' -U postgres