I hereby claim:
- I am haletom on github.
- I am tomhale (https://keybase.io/tomhale) on keybase.
- I have a public key ASA0UCq38IWRstxf9o5_HXYCzXjb7paM7SF7QfHRykoxsAo
To claim this, I am signing this object:
Verifying that +tomhale is my blockchain ID. https://onename.com/tomhale |
# System-wide .bashrc file for interactive bash(1) shells. | |
# To enable the settings / commands in this file for login shells as well, | |
# this file has to be sourced in /etc/profile. | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines or lines starting with space in the history. | |
# See bash(1) for more options |
# Print the name of the git repository's working tree's root directory | |
# Search for 'Tom Hale' in http://stackoverflow.com/questions/957928/is-there-a-way-to-get-the-git-root-directory-in-one-command | |
# Or, shorter: | |
# (root=$(git rev-parse --git-dir)/ && cd ${root%%/.git/*} && git rev-parse && pwd) | |
# but this doesn't cover external $GIT_DIRs which are named other than .git | |
function git_root { | |
local root first_commit | |
# git displays its own error if not in a repository | |
root=$(git rev-parse --show-toplevel) || return | |
if [[ -n $root ]]; then |
#!/bin/bash | |
# Usage: gem-patch | |
# Code updates: https://gist.github.com/HaleTom/275f28403828b9b9b93d313990fc94f4 | |
# Features: | |
# Work around `patch` returning non-zero if some patch hunks are already applied | |
# Apply all patches in $patch_dir (in order) to their corresponding gem(s) | |
# Build a gem only after all patches have been applied | |
# Only build the gem if it was patched |
#!/bin/bash -eu | |
table_to_update=./compatible_table | |
source_extract=./option_extract | |
function get_decorated_options { | |
# option_extract > while read -r option; | |
while read -r line; do | |
name=$(printf %s "$line" | sed -rn 's/^\s*\{\s*"(\w+).*/\1/p') | |
# Get decoration |
#!/bin/bash | |
# Safely backup the pacman databases to enable reversal of system upgrade. | |
# Use pacman -b <backupdirectory> to use the saved databses | |
# Latest version: https://gist.github.com/HaleTom/9dbffaf3369b86ca272ffe6a61a36aba | |
set -euo pipefail; shopt -s failglob # safe mode | |
db_lock=/var/lib/pacman/db.lck |
% Based upon https://stackoverflow.com/a/45347880/5353461 | |
% Gist at: https://gist.github.com/HaleTom/533b0ed7c51f93bfb5f71007a188bac4 | |
function varargout = describe(varargin) | |
% varargin used to accommodate variable number of input names | |
st = dbstack; | |
outstring = ''; | |
for ii = size(st, 1):-1:2 | |
outstring = [outstring, st(ii).file, ' > ', st(ii).name, ', line ', num2str(st(ii).line), '\n']; | |
end |
function [J grad] = nnCostFunction(nn_params, ... | |
input_layer_size, ... | |
hidden_layer_size, ... | |
num_labels, ... | |
X, Y, lambda) | |
%NNCOSTFUNCTION Implements the neural network cost function for a two layer | |
%neural network which performs classification | |
% [J grad] = NNCOSTFUNCTON(nn_params, hidden_layer_size, num_labels, ... | |
% X, y, lambda) computes the cost and gradient of the neural network. The | |
% parameters for the neural network are "unrolled" into the vector |
I hereby claim:
To claim this, I am signing this object: