Skip to content

Instantly share code, notes, and snippets.

@nnutter
nnutter / 00-cloud-config.yml
Created March 6, 2021 21:42 — forked from janeczku/00-cloud-config.yml
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher
@nnutter
nnutter / config.json
Created April 28, 2019 23:12
Whitespace+ Config
{
"mode": "all",
"autoStart": true,
"refreshRate": 100,
"elements":
[{
"name": "space",
"enabled": false,
"pattern": "\\s",
"style": {
@nnutter
nnutter / 00-Git-HOME.md
Last active December 4, 2017 17:50
Workshop: Puppet Development with Vim

Use Git to manage $HOME

Caveats

  • Untracked files won't show up if hidden. To audit, temporarily re-enable with gh status --untracked-files=normal.
  • Have to convert submodule paths in .gitmodules to relative paths.

Setup

  1. Create a script called gh and put it in your PATH,

Keybase proof

I hereby claim:

  • I am nnutter on github.
  • I am nnutter (https://keybase.io/nnutter) on keybase.
  • I have a public key ASAtxpiRyQHdyzTW6eF5s7Sebsvvy5hz-nMFCFkSYLYoHgo

To claim this, I am signing this object:

@nnutter
nnutter / readme.md
Last active January 16, 2017 04:53
1Password Migration Notes
  • pass: a light GPG wrapper to store password as files (and version with Git).
  • Tool to conver 1Password .1pif into a pass store, 1password2pass. Doesn't work with my .1pif file; maybe because mine is an older version?
  • Android app for pass, Password Store.
  • Firefox extension for pass, PassFF.
@nnutter
nnutter / ssh.js
Last active May 2, 2018 18:39
Tomorrow Night for Chrome OS's Secure Shell (and Crosh Window)
// Based on the lilyterm config,
// https://github.com/chriskempson/tomorrow-theme/blob/0e0d35ac303f99b8aa182091ebeaee81cf2183a0/lilyterm/default.conf#L482-L497
// https://github.com/giraj/solarized-crosh
term_.prefs_.set('environment', { TERM: "xterm-256color" })
term_.prefs_.set('foreground-color', '#c5c8c6')
term_.prefs_.set('background-color', '#1d1f21')
term_.prefs_.set('cursor-color', '#aeafad')
term_.prefs_.set('color-palette-overrides',[
"#000000",
"#912226",
@nnutter
nnutter / mocking.md
Last active October 13, 2016 21:36
Mocking

Test Doubles

[Others][mf_mocks] have defined four types of test doubles which are often colloqually referred to as mocking, mock objects, etc.

  • Dummy objects are passed around but never actually used. Usually they are just used to fill parameter lists.
  • Fake objects actually have working implementations, but usually take some shortcut which makes them not suitable for production (an in memory database is a good example).
  • Stubs provide canned answers to calls made during the test, usually not responding at all to anything outside what's programmed in for the test. Stubs may also record information about calls, such as an email gateway stub that remembers the messages it 'sent', or maybe only how many messages it 'sent'.
  • Mocks objects are pre-programmed with expectations which form a specification of the calls they are expected to receive.

Why use mocking?

@nnutter
nnutter / AppleVendingMachine.swift
Last active January 2, 2016 07:15 — forked from eofster/VendingMachine.swift
Vending machine with long vend() function
struct Item {
var price: Int
var count: Int
}
enum VendingMachineError: ErrorType {
case InvalidSelection
case InsufficientFunds(coinsNeeded: Int)
case OutOfStock
}
@nnutter
nnutter / xf86-input-cmt.md
Last active December 6, 2015 20:47
Chromebook Pixel

Invert scrolling direction, e.g. enable "Natural Scrolling":

$ DEV_ID=$(xinput | grep 'Atmel.*Touchpad' | -E 's/.*id=([0-9]+).*/\1/')
$ xinput --list-props $DEV_ID > backup_touchpad_props.txt

$ PROP_ID=$(xinput --list-props 9 | grep 'Scroll X Out Scale' | sed -E 's/.*\(([0-9]+)\).*/\1/')
$ PROP_VAL=$(xinput --list-props 9 | grep 'Scroll X Out Scale' | sed -E 's/.*[^.0-9]([.0-9]+)/\1/')
$ xinput --set-float-prop $DEV_ID $PROP_ID -$PROP_VAL
$ xinput --list-props $DEV_ID | grep 'Scroll X Out Scale'
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'genome/ubuntu-lucid-puppet'
config.vm.hostname = 'localhost'