Skip to content

Instantly share code, notes, and snippets.

View chrisortman's full-sized avatar

Chris Ortman chrisortman

View GitHub Profile
<div class="lg:hidden">
<label for="selected-tab" class="sr-only">Select a tab</label>
<select id="selected-tab" name="selected-tab" class="block w-full py-2 pl-3 pr-10 mt-1 text-base border-gray-300 focus:outline-none focus:ring-purple-500 focus:border-purple-500 sm:text-sm rounded-md">
<% tabs.each do |t| %>
<option><%= t.text %></option>
<% end %>
</select>
</div>
<div class="hidden lg:block">
defmodule Common do
defmacro __using__(_opts) do
quote do
def validate(thing) do
Common.validate({__MODULE__, thing})
end
end
end
@chrisortman
chrisortman / aws_filter.jq
Last active April 15, 2019 12:07
Shell stuff for putting AWS context in my prompt (make sure jq is on your path)
if .Account == "9999999" then "test" elif .Account == "111111" then "prod" else "" end
@chrisortman
chrisortman / split_palette.rb
Created March 22, 2019 16:17
Splits SIP v1 palette file to separate files you can import into SIP v2
#Run these in your terminal first to copy the file and make the output folder
#cp ~/.sip_v1/.palettes.json ~/Desktop/old_sip.palette
#mkdir -p ~/Desktop/sip
#then run this script with ruby
require 'json'
require 'securerandom'
color_ids = Hash.new { |h,k| h[k] = SecureRandom.uuid }
@chrisortman
chrisortman / create_import_csv.rb
Created November 27, 2017 19:32
Converts constants.yml values to CSV for import into permissible values
require 'yaml'
require 'csv'
require 'pathname'
SPARC_HOME = Rails.root
CONSTANTS_FILE = SPARC_HOME + "config/constants.yml"
OUTPUT_DIR = SPARC_HOME + "db/seeds/permissible_values/2.0.5"
EXTRACT_KEYS = {
"affiliations" => "affiliation_types",
"document_types" => "document_types",

Keybase proof

I hereby claim:

  • I am chrisortman on github.
  • I am chriso (https://keybase.io/chriso) on keybase.
  • I have a public key ASDxxTaq45u7EKuikWvz-HevdVWdB-a-QmJzRb8zTj9ElQo

To claim this, I am signing this object:

@chrisortman
chrisortman / long_run.py
Created May 26, 2017 15:45
Streaming external program output in elixir
from sys import argv
from time import sleep
defaults = [
"Output",
30,
.25
]
for index, arg in enumerate(argv[1:]):
@chrisortman
chrisortman / migrate.exs
Created January 1, 2017 20:09
How to bulk generate UUID values for a new column
for id <- Repo.all( from r in "recipients", select: r.id ),
{id, uid} = {id, Ecto.UUID.bingenerate},
do: from(r in "recipients", where: r.id == ^id, update: [set: [uid: ^uid]])
|> Repo.update_all([])
@chrisortman
chrisortman / README.md
Last active August 23, 2016 18:51
Agile / Scrum / Lean

I don’t think there’s anything in agile that has no value. I’ve seen times where stand-ups, sprint planning, estimating, and time-boxed iterations weren’t optimal, but were used anyway. (scrum wikipedia entry lists most of them as when you shouldn’t use scrum) I think the best results come from identifying your feedback loops/channels and making them as small as possible.

I also think it is a mistake to try to insert a product owner / scrum master in between the stake holders and the people doing the work (assuming the stakeholders understand the problem domain). When you can sit the team next to the person who has the problem is when you can get the best results.

I’ve been places that have said we’re using agile, because they were doing scrum because they had a daily stand up and user stories and a project manager whose job it was to gather requirements and deliver them to programmers who then had to estimate those stories and then sign up for them in a sprint planning meeting and …. but at the same tim

@chrisortman
chrisortman / test-me.sh
Created February 25, 2016 15:26
Simple script for running an rspec test during git-bisect
set +e
RAILS_ENV=test bundle exec rake db:schema:load
bundle exec rspec spec/models/arm/create_line_items_visit_spec.rb:57
test_result=$?
echo Test complete
git checkout HEAD Gemfile.lock
exit $test_result