Skip to content

Instantly share code, notes, and snippets.

View straightjacket's full-sized avatar
🏠
Working from home

Theron Blount straightjacket

🏠
Working from home
View GitHub Profile
@straightjacket
straightjacket / adapter.py
Created May 17, 2018 01:20 — forked from pazdera/adapter.py
Example of `adapter' design pattern in Python
View adapter.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of `adapter' design pattern
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@straightjacket
straightjacket / brew-perms.sh
Created April 6, 2017 21:20 — forked from jaibeee/brew-perms.sh
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
View brew-perms.sh
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@straightjacket
straightjacket / gtest-install.rst
Created February 22, 2017 21:08 — forked from massenz/gtest-install.rst
Describes how to install and run GTest, a Google framework to conduct unit testing in C++
View gtest-install.rst

Build and install Google Test

Download the latest_ (1.7.0) from Google Code (Q: where is it going to live, once GCode shuts down?)

Then follow the primer_, but more to the point, the README (YMMV) Having installed CLion and cmake, this is how I built gtest:

brew install cmake
cd gtest-1.7.0
View tracwiki.rb
#!/usr/bin/ruby
# Convert a spreadsheet contents into Trac Wiki format
# How to use?
# sudo gem install spreadsheet
# ruby tracwiki.rb /path/to/spreadsheet.xls "sheet-name"
#
require 'rubygems'
require 'spreadsheet'
xlsfile = ARGV[0] if ARGV.length > 0
@straightjacket
straightjacket / financials.rb
Created October 1, 2013 23:42
A quick script to crunch bank numbers.
View financials.rb
require 'pp'
require 'yaml'
require 'date'
require 'rspec'
PRINT_ALL = true
class Financials
@@financials = YAML.load_file('funds.yml')