Skip to content

Instantly share code, notes, and snippets.

View waynr's full-sized avatar
🙊

wayne waynr

🙊
  • somewhere around here
View GitHub Profile
@waynr
waynr / day10.rs
Created December 11, 2023 21:21
aoc 2023 solutions
#[allow(dead_code)]
use std::path::PathBuf;
use itertools::iproduct;
use nom::*;
use nom::{branch::*, character::complete::*, combinator::*, multi::*};
use nom_locate::LocatedSpan;
use crate::download::CachedDownloader;
use crate::parsers::Span;
group gotools {
perm {
admin {
uid = UID;
gid = UID;
}
task {
uid = UID;
gid = UID;
}
@waynr
waynr / building kwasm-networking
Created November 9, 2019 16:49
kernel-wasm module loading problems
make -C /lib/modules/4.19.0-6-amd64/build M=/home/wayne/projects/wasmerio/kernel-wasm/networking modules
make[1]: Entering directory '/usr/src/linux-headers-4.19.0-6-amd64'
CC [M] /home/wayne/projects/wasmerio/kernel-wasm/networking/ext.o
LD [M] /home/wayne/projects/wasmerio/kernel-wasm/networking/kwasm-networking.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "kwasm_resolver_deregister" [/home/wayne/projects/wasmerio/kernel-wasm/networking/kwasm-networking.ko] undefined!
WARNING: "kwasm_resolver_register" [/home/wayne/projects/wasmerio/kernel-wasm/networking/kwasm-networking.ko] undefined!
CC /home/wayne/projects/wasmerio/kernel-wasm/networking/kwasm-networking.mod.o
LD [M] /home/wayne/projects/wasmerio/kernel-wasm/networking/kwasm-networking.ko
@waynr
waynr / ability_scores.py
Last active May 17, 2019 13:17
d&d ability score generator
#!/usr/bin/env python3
import random
import click
def abscore():
rolls = [random.randint(2,6) for i in range(4)]
rolls.sort()
return sum(rolls[1:])
@waynr
waynr / LanguageClient.log
Last active November 19, 2018 21:14
attempt to get neovim + rls + LanguageClient-neovim working together
11:07:36 INFO reader-main src/vim.rs:390 <= None {"id": 1, "jsonrpc": "2.0", "method": "languageClient/findLocations", "params": {"gotoCmd": null, "character": 43, "handle": true, "languageId": "rust", "method": "textDocument/definition", "line": 8, "buftype": "", "text": ["extern crate rand;", "", "use std::io;", "use rand::Rng;", "", "fn main() {", " println!(\"guess a number\");", "", " let secret_number = rand::thread_rng().gen_range(1, 101);", "", " println!(\"the secret number is: {}\", secret_number);", "", " println!(\"please input your guess:\");", "", " let mut guess = String::new();", "", " io::stdin().read_line(&mut guess)", " .expect(\"failed to read line\");", "", " println!(\"You guessed: {}\", guess);", "}", ""], "filename": "/home/wayne/projects/learn/rust-lang-book/guessing_game/src/main.rs"}}
11:07:36 INFO main src/languageclient.rs:1741 Begin textDocument/didChange
11:07:36 INFO main src/languageclient.rs:49 gather_args: [LanguageId, Filename] = [String("rust"),
@waynr
waynr / minimal-example.log
Created July 5, 2017 19:05
weird pdflatex problem
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex 2017.6.11) 5 JUL 2017 12:03
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**minimal-example.tex
(./minimal-example.tex
LaTeX2e <2017/01/01> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
@waynr
waynr / get-metrics.py
Created December 7, 2016 20:38
sqlalchemy jenkins metrics db query
#!/usr/bin/env python
import datetime
from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.orm import sessionmaker
engine = create_engine('postgres://meow:[email protected]/jenkins_meow')
meta = MetaData(bind=engine)
jenkins_runs = Table("jenkins_details_run", meta, autoload=True, autoload_with=engine)
@waynr
waynr / cfg.rs
Last active March 1, 2016 20:26
WIP toml -> notty::Config
// notty is a new kind of terminal emulator.
// Copyright (C) 2015 without boats
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@waynr
waynr / job.py
Created January 10, 2016 01:16
SimpleJob definition
# Copyright (C) 2016 Wayne Warren
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@waynr
waynr / compare-jenkins-plugins.py
Created August 26, 2015 16:03
Script that compares plugin info between different Jenkins instances
import argparse
import sys
import jenkins
from datadiff import diff
def distill_plugins(plugins_info):
ret = {}