Skip to content

Instantly share code, notes, and snippets.

Devyn Cairns devyn

Block or report user

Report or block devyn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keyed.rs
use std::cmp::Ordering;
trait Keyed<'a> {
type Key: 'a + Eq + Ord;
fn key(&'a self) -> Self::Key;
}
#[derive(Debug, Clone)]
struct TypeA {
View move-to-netns.sh
#!/bin/bash
# https://coldfix.eu/2017/01/29/vpn-box/
up() {
# ensure alternate resolv.conf exists
# otherwise system resolv.conf will be overwritten
[[ -d /etc/netns/vpn ]] || mkdir -p /etc/netns/vpn
[[ -e /etc/netns/vpn/resolv.conf ]] || touch /etc/netns/vpn/resolv.conf
# create network namespace
View asynccompare.js
// With async
function foo(callback) {
async.series([
function (done) {
one("x", done);
},
function (done) {
if (FOO) {
two("y", done);
@devyn
devyn / gist:d2b69e8c264ef7639f10
Last active Aug 29, 2015
Kit shell pseudocode
View gist:d2b69e8c264ef7639f10
1 > logger = !LogInput
[3414] logger
2 > logger.send({key: "value"})
logger: Received {key: "value"} from 2929
3 > !Echo
Error: Must assign spawned process to variable
4 > echo = !Echo
5 > echo.send(1234)
6 > echo.recv()
1234
View gist:d9ff282df07a27b50325
nor(out, A, B) {
out !- A + B;
}
nand(out, A, B) {
notA !- A;
notB !- B;
out <- notA + notB;
}
View 0.original.tires
implementation console trace[] Hi @#two;
infrastructure affix[] [ foo[] a b c d [two: implementation console explode[] Yo!] ];
View ordering.paws.md

Ordering guarantees in Paws

New call-pattern

Caller should own itself.

  1. Clone the subject.
  2. Request ownership for the subject clone over itself.
  3. Request ownership for the subject clone over caller.
  4. Stage subject clone with message. Can not realize until next step due to
View gist:4a4a2ca6766d7db276dd
==1071== Memcheck, a memory error detector
==1071== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==1071== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==1071== Command: build/libpaws-tests
==1071==
==1071== Conditional jump or move depends on uninitialised value(s)
==1071== at 0x525332: terminfo::parser::compiled::parse::h585454ead94a4ccfLAa (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==1071== by 0x53624E: terminfo::TerminfoTerminal$LT$T$GT$.Terminal$LT$T$GT$::new::h16534774972133198398 (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==1071== by 0x535BA6: stdout::hcef6206484deeb69ahc (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==1071== by 0x4D3566: run_tests_console::h78b6f57265fba520uFc (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
View libpaws-tests-deps.mk
build/libpaws-tests: src/lib/paws.rs src/lib/cpaws/mod.rs src/lib/cpaws/tests.rs src/lib/object/mod.rs src/lib/object/cache/mod.rs src/lib/object/cache/tests.rs src/lib/object/members.rs src/lib/object/tests.rs src/lib/nuketype/mod.rs src/lib/nuketype/thing/mod.rs src/lib/nuketype/symbol/mod.rs src/lib/nuketype/symbol/tests.rs src/lib/nuketype/execution/mod.rs src/lib/nuketype/execution/tests.rs src/lib/nuketype/alien/mod.rs src/lib/nuketype/alien/tests.rs src/lib/nuketype/locals/mod.rs src/lib/nuketype/locals/tests.rs src/lib/script/mod.rs src/lib/machine/mod.rs src/lib/machine/reactor/mod.rs src/lib/machine/reactor/mock.rs src/lib/machine/reactor/serial.rs src/lib/machine/reactor/parallel.rs src/lib/machine/reactor/tests.rs src/lib/machine/tests.rs src/lib/system/mod.rs src/lib/system/infrastructure/mod.rs src/lib/system/infrastructure/label/mod.rs src/lib/system/infrastructure/execution/mod.rs src/lib/system/implementation/mod.rs src/lib/system/implementation/console/mod.rs src/lib/system/implementation/te
View gist:2db7182c90f740d52ad7
==27455== Memcheck, a memory error detector
==27455== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==27455== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==27455== Command: build/libpaws-tests
==27455==
==27455== Conditional jump or move depends on uninitialised value(s)
==27455== at 0x501BB8: parse_opts::h7a5697aaa83f35aepFb (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==27455== by 0x50176D: test_main::hee3771f43c4320c6rvb (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==27455== by 0x50C6E0: test_main_static::hf8903d13bd63fd87czb (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==27455== by 0x4C9723: __test::main::h27d4f9fac1d9661cGim (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
You can’t perform that action at this time.