Skip to content

Instantly share code, notes, and snippets.

View bowmanmike's full-sized avatar

Mike Bowman bowmanmike

View GitHub Profile
@bowmanmike
bowmanmike / dynamic_function_calls.go
Created February 22, 2017 19:06
Golang Dynamic Function Calling
package main
import (
"fmt"
)
// Use map[string]interface{} to pair functions to name
// Could maybe use anonymous functions instead. Might be clean
// in certain cases
var funcMap = map[string]interface{}{
@bowmanmike
bowmanmike / bd3d4befe38185704bf0fc875e9deed6|configuration.json
Last active December 8, 2020 15:42
Visual Studio Code Sync Settings Gist
{"contents":{"python":{"pythonPath":"/usr/local/bin/python"},"launch":{"version":"0.2.0","configurations":[{"name":"Listen for rdebug-ide","type":"Ruby","request":"attach","cwd":"${workspaceRoot}","remoteHost":"127.0.0.1","remotePort":"1234","remoteWorkspaceRoot":"${workspaceRoot}"},{"name":"Rails server","type":"Ruby","request":"launch","cwd":"${workspaceRoot}/thescore-api","program":"${cwd}/bin/rails","args":["server"]},{"name":"RSpec - active spec file only","type":"Ruby","request":"launch","cwd":"${workspaceRoot}","program":"/Users/mbowman/thescore/sports/thescore-pulse/pulse/bin/rspec","args":["--require","spec_helper","${file}"]}]},"tasks":{"version":"2.0.0","tasks":[{"label":"rake db:migrate","type":"shell","command":"bundle exec rake db:migrate","options":{"cwd":"/Users/mbowman/thescore/sports/thescore-api"},"problemMatcher":[]},{"label":"rake db:test:prepare","type":"shell","command":"bundle exec rake db:test:prepare","options":{"cwd":"/Users/mbowman/thescore/sports/thescore-api"},"problemMatcher":[]
@bowmanmike
bowmanmike / pre-push
Last active October 28, 2020 20:52
Print confirmation before pushing to master
branch="$(git branch --show-current)"
if [ $branch = "master" ]; then
echo "WARNING!!!"
echo "You're currently pushing directly to master!"
echo ""
read -p "Are you sure? Type 'yes' to confirm: " answer
if [ $answer = "yes" ]; then
echo "Pushing..."
@bowmanmike
bowmanmike / tasks.json
Created June 6, 2020 21:10
VSCode Elixir tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "mix test -- all",
"type": "shell",
"group": "test",
"command": "mix test",
@bowmanmike
bowmanmike / daily_progress_template.md
Created July 6, 2017 17:51
Daily progress tracker template
Atom Sync Settings
@bowmanmike
bowmanmike / coverage
Last active November 28, 2016 21:44
Go Test Coverage Aggregator
#!/bin/sh
# Generate test coverage statistics for Go packages.
# Adapted from https://github.com/mlafeldt/chef-runner/blob/v0.7.0/script/coverage
#
# Works around the fact that `go test -coverprofile` currently does not work
# with multiple packages, see https://code.google.com/p/go/issues/detail?id=6909
#
# Usage: script/coverage [--html|--coveralls]
#
# --html Additionally create HTML report and open it in browser