Skip to content

Instantly share code, notes, and snippets.

View afair's full-sized avatar

Allen Fair afair

View GitHub Profile
@afair
afair / hackintosh3.md
Last active June 15, 2020 17:31
Hackintosh #3 [2018]

Hackintosh #3 (2018)

Build

  • Corsair Carbide 200R Windowed Compact ATX Case
  • Corsair CX Series CX750M 750 Watt 80 Plus Bronze ATX Modular Power Supply
  • Gigabyte GA-Z270M-D3H LGA 1151 mATX Intel Motherboard
    • Intel Z270
    • Core i7 / i5 / i3 / Pentium / Celeron (LGA1151)
    • 4x288pin up to 64GB DR4 3866(O.C.)/ 3800(O.C.)/ 3733(O.C.)/ 3666(O.C.)/ 3600(O.C.)/ 3466(O.C.)/ 3400(O.C.)/ 3333(O.C.)/ 3300(O.C.)/ 3200(O.C.)/ 3000(O.C.)/ 2800(O.C.)/ 2666(O.C.)/ 2400(O.C.)/ 2133
  • Realtek ALC892
@afair
afair / issue.rb
Created December 4, 2017 20:27
Possible AR Polymorphic Association Regression (5.2.0.beta2)?
# frozen_string_literal: true
# https://raw.githubusercontent.com/rails/rails/master/guides/bug_report_templates/active_record_master.rb
gem "bundler", "< 1.16"
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
@afair
afair / alternate-dot-vim.md
Last active July 13, 2017 14:00
Create a separate dot-vim configurations for alternate users or re-building your own.

Manage multiple dot-vim configurations

The final repo is available here.

This technique is useful to:

  • Refresh your vim configuration but keep using the old one until ready to cut over.
  • Give another user (pair programmer) thier own vim configuration on your account
  • Have an alternate configuration for a special purpose
@afair
afair / ZenCode.js
Created August 23, 2016 21:12
To study the React Redux Starter Kit Tutorial
// https://suspicious.website/2016/04/29/starting-out-with-react-redux-starter-kit/
// ################################################################################
// src/routes/Zen/interfaces/zen.js
/* @flow */
export type ZenObject = {
id: number,
value: string
@afair
afair / vm.sh
Last active October 18, 2021 21:55
VM command to wrap virtualbox vboxmanage commands
#!/bin/bash
# install - http://www.unixmen.com/install-oracle-virtualbox-and-manage-it-using-phpvirtualbox-on-ubuntu-15-10-headless-server/
# remoting - http://www.virtualbox.org/manual/ch07.html
# vboxmanage - http://www.virtualbox.org/manual/ch08.html
if [ "$1" = "" ]; then
echo "Usage: vm command vmname args..."
exit
fi
# FreeBSD Jails
via https://clinta.github.io/freebsd-jails-the-hard-way/
* VirtualBox
* Intall, with ZFS, admin user as sudo admin
* ssh -p 2222 admin@127.0.0.1
* Jail Host, for use with PostgreSQL
* https://www.textplain.net/tutorials/2015/running-postgresql-in-freebsd-jails/
* /etc/sysctl.conf: security.jail.sysvipc_allowed=1
@afair
afair / passenger-install-apache2-module-5.0.8.log
Last active August 29, 2015 14:28
passenger-install-apache2-module, versions 5.0.8 Success! :-)
allen@dev2 % passenger-install-apache2-module ~
Welcome to the Phusion Passenger Apache 2 module installer, v5.0.8.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
@afair
afair / passenger-install-apache2-module.log
Created August 25, 2015 16:55
passenger-install-apache2-module, versions 5.0.9 through 5.0.16, Failure :-(
allen@dev2 % uname -a ~
FreeBSD dev2.xxx.com 8.4-RELEASE-p9 FreeBSD 8.4-RELEASE-p9 #13 r265131: Wed Apr 30 02:18:42 EDT 2014 spork@xxx.com:/usr/obj/usr/src/sys/DEVEL4 amd64
allen@dev2 % ruby -v ~
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-freebsd8.4]
allen@dev2 [1] % passenger-install-apache2-module ~
Welcome to the Phusion Passenger Apache 2 module installer, v5.0.16.
This installer will guide you through the entire installation process. It
@afair
afair / partition.sql
Created July 14, 2015 20:08
PostgreSQL Partitioned Table Example Usage
drop table if exists data cascade;
create table data (
id uuid not null default uuid_generate_v4(),
month integer not null,
data json not null);
drop table if exists data_201501;
create table data_201501 (
check ( month = 201501 )
) inherits (data);
@afair
afair / example_spec.rb
Created March 3, 2015 15:55
RSpec3 Template Spec and Reference by Example
require 'spec_helper'
describe Widget do
# Setup, Exercise, Verify, Teardown!
describe '#instance_method' do
subject { buid_stubbed(:widget) }
it 'works' do
expect(subject.name).to be_nil