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 / foo.nomnoml
Last active February 5, 2023 21:40
nomnoml example
[readme] -> [browser]
[browser] -> [nomnoml-service]
[nomnoml-service] -> [gist]
[nomnoml-service] -> [browser]
@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
@reklis
reklis / mkvocore.sh
Last active December 3, 2015 22:40
vocore mac install
#!/usr/bin/env bash
################################################################################
## docs
##
## http://vocore.io/wiki/index/id:13
## https://wiki.openwrt.org/easy.build.macosx
## https://wiki.openwrt.org/doc/howto/buildroot.exigence.macosx
################################################################################
@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 / post-update
Last active August 29, 2015 14:18
git hooks example
#!/bin/bash
# server-side post-update deployment hook
# https://www.gnu.org/software/bash/manual/bash.html#The-Set-Builtin
set -e # exit immediately if anything is non-zero return
set -m # enable background jobs
set -u # undefined variables are an error
set -x # echo the commands while they are executed
@reklis
reklis / make_positive_graph.sh
Last active August 29, 2015 14:18
twitter sentiment analysis graph
# brew install jshon
# npm i -g json
# npm i -g underscore-cli
json -g -c 'this.tweet.in_reply_to_screen_name' < sample.json | underscore process '_.map(data, function(value) { return {
valence: value.valence,
polarity: value.polarity,
user: value.tweet.user.screen_name,
mentions: _.map(value.tweet.entities.user_mentions, function(mention) { return mention.screen_name })
}})' | underscore filter 'value.mentions.length' | underscore process '_.groupBy(data, "valence")' | jshon -e positive | underscore process '_.map(data, function(d) {
@reklis
reklis / spiral.itermcolors
Created April 1, 2015 19:28
spiral iterm2 colors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.29803922772407532</real>
<key>Green Component</key>
<real>0.29803922772407532</real>