Skip to content

Instantly share code, notes, and snippets.

View boj's full-sized avatar

Brian Jones boj

  • Eagle River, Alaska
View GitHub Profile
@boj
boj / Oscillator.cs
Created November 9, 2012 15:43
Oscillator Experiment
using UnityEngine;
using System;
using System.Diagnostics;
using System.Threading;
// http://www.codeproject.com/Articles/30180/Simple-Signal-Generator
// http://blogs.msdn.com/b/dawate/archive/2009/06/25/intro-to-audio-programming-part-4-algorithms-for-different-sound-waves-in-c.aspx
class Oscilator : MonoBehaviour {
@boj
boj / benchmark.go
Last active April 9, 2019 16:26
mgo insert loop - parallelized vs. standard - The point of this test isn't to check the throughput of inserting 10000 records using mgo, but to explore the difference between doing standard and parallel loops using an overblown common case. Out of curiosity I have added a bulk insert benchmark at the bottom, which is clearly the most powerful wa…
package test
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"testing"
)
const INSERT_COUNT int = 10000
@boj
boj / brad.html
Last active December 17, 2015 04:39
<html>
<head>
<title> while </title>
</head>
<body>
<script type="text/javascript">
var i=0;
while (i<=10) {
document.write("The number is " + i);
document.write("<br />");
#!/bin/bash
CWD=$(cd $(dirname $0); pwd)
BASE_DIR="${CWD}/dev"
echo "Creating dev directory ${BASE_DIR}"
mkdir "${BASE_DIR}"
for node in 1 2 3 4 5; do
NODE_NAME="dev${node}"
@boj
boj / keybase.md
Created April 12, 2014 01:17
Keybase Verification

Keybase proof

I hereby claim:

  • I am boj on github.
  • I am bojo (https://keybase.io/bojo) on keybase.
  • I have a public key whose fingerprint is 73A9 7668 5127 7811 DAA5 40F6 928F 77AD 6F70 5944

To claim this, I am signing this object:

@boj
boj / daily.sh
Created September 6, 2014 05:14
ZFS Backup Plan
#!/bin/sh
zfs destroy -r zroot/var/db/mongodb@7daysago
zfs rename -r zroot/var/db/mongodb@6daysago @7daysago
zfs rename -r zroot/var/db/mongodb@5daysago @6daysago
zfs rename -r zroot/var/db/mongodb@4daysago @5daysago
zfs rename -r zroot/var/db/mongodb@3daysago @4daysago
zfs rename -r zroot/var/db/mongodb@2daysago @3daysago
zfs rename -r zroot/var/db/mongodb@yesterday @2daysago
zfs rename -r zroot/var/db/mongodb@today @yesterday
package main
import (
"net/http"
)
func Call(w http.ResponseWriter, r *http.Request) {
}
{ 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
@boj
boj / .spacemacs
Created September 30, 2015 00:51
;; -*- mode: dotspacemacs -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
@boj
boj / config
Last active February 15, 2023 18:02
VMWare NixOS
// .config/termite/config
[options]
font = Liberation Mono 10
[colors]
foreground = #FFFFFF
background = #000000