Skip to content

Instantly share code, notes, and snippets.

# nvidia
hardware.nvidia.modesetting.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.driSupport32Bit = true;
nixpkgs.config.cudaSupport = true;
virtualisation.docker.enableNvidia = true;
virtualisation.docker.extraOptions = "--add-runtime nvidia=/run/current-system/sw/bin/nvidia-container-runtime";
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
boot.kernelParams = [ "module_blacklist=i915" ];
@reklis
reklis / Example.cpp
Created September 15, 2015 19:40
reliability-and-flow-control
/*
Reliability and Flow Control Example
From "Networking for Game Programmers" - http://www.gaffer.org/networking-for-game-programmers
Author: Glenn Fiedler <gaffer@gaffer.org>
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
@reklis
reklis / foo.nomnoml
Last active February 5, 2023 21:40
nomnoml example
[readme] -> [browser]
[browser] -> [nomnoml-service]
[nomnoml-service] -> [gist]
[nomnoml-service] -> [browser]
@reklis
reklis / -
Created October 3, 2014 13:00
bsd/dev/dtrace/dtrace.c:19734: if (!PE_parse_boot_argn("dtrace_dof_mode", &dtrace_dof_mode, sizeof (dtrace_dof_mode))) {
bsd/dev/dtrace/dtrace.c:19764: if (!PE_parse_boot_argn("dtrace_kernel_symbol_mode", &dtrace_kernel_symbol_mode, sizeof (dtrace_kernel_symbol_mode))) {
bsd/dev/dtrace/fbt.c:477: PE_parse_boot_argn("IgnoreFBTBlacklist", &gIgnoreFBTBlacklist, sizeof (gIgnoreFBTBlacklist));
bsd/dev/unix_startup.c:261: (void) PE_parse_boot_argn("ncl", &ncl, sizeof (ncl));
bsd/dev/unix_startup.c:262: (void) PE_parse_boot_argn("mbuf_pool", &mbuf_pool, sizeof (mbuf_pool));
bsd/kern/bsd_init.c:1113: if (PE_parse_boot_argn("-s", namep, sizeof (namep)))
bsd/kern/bsd_init.c:1116: if (PE_parse_boot_argn("-b", namep, sizeof (namep)))
bsd/kern/bsd_init.c:1119: if (PE_parse_boot_argn("-x", namep, sizeof (namep))) /* safe boot */
bsd/kern/bsd_init.c:1123: if (PE_parse_boot_argn("-vnode_cache_defeat", namep, sizeof (namep)))
bsd/kern/bsd_init.c:1127: if (PE_parse_boot_argn("-disable_aslr", namep, sizeof (namep)))
/* Copyright (c) 2010 Robert Blackwood
*
* Based upon Box2d's b2PulleyJoint equations:
* Copyright (c) 2007 Erin Catto http://www.gphysics.com
*
* 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
@reklis
reklis / makefatlib.sh
Created July 25, 2012 20:46
Make a simulator+device .a file with headers
# http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
TARGET_NAME=<< name of your target or an environment variable >>
CONFIGURATION=Release
DEVICE=iphoneos
SIMULATOR=iphonesimulator
FAT=universal
OUTPUT=build
LIBRARY_NAME=lib${TARGET_NAME}.a
@reklis
reklis / edit-map.diff
Created September 22, 2011 13:50
SVG map changes
diff --git a/ElectionMeterDemo/Images/Map.svg b/ElectionMeterDemo/Images/Map.svg
index 46ccbd3..4b73095 100644
--- a/ElectionMeterDemo/Images/Map.svg
+++ b/ElectionMeterDemo/Images/Map.svg
@@ -11,9 +11,10 @@
height="593"
id="svg2"
sodipodi:version="0.32"
- inkscape:version="0.46"
- sodipodi:docname="United States WIP.svg"
@reklis
reklis / task.js
Created March 24, 2017 22:01
example of tj style task library
const fs = require('fs')
function task(fn) {
const gen = fn()
function step(err, res) {
const ret = gen.next(res)
if (ret.done) return
ret.value(step)
}
@reklis
reklis / docker.sh
Created September 28, 2016 02:50
docker shell profile stuff
function docker-start() {
machine_status=$(docker-machine status)
if [ "Stopped" == $machine_status ]
then
docker-machine start default
fi
eval "$(docker-machine env default)"
}
@reklis
reklis / sw.txt
Created September 3, 2016 02:18
programming languages => characters in the Star Wars universe
Assembly. R2-D2
Asm.js. BB8
Basic. Mouse Droid
Visual Basic 6. GNK Droid
C. Yoda
D. Light Saber
C++. Yoda with a Light Saber
Objective-C. Old Obi-Won
C#. Jedi Luke
Delphi. Lando Calrissian