Skip to content

Instantly share code, notes, and snippets.

@jfinucane
jfinucane / gist:687561aa20d152ced0a0e759a5b7e44d
Created January 6, 2019 16:53
Minishift start after successful install
jimfinucaneDC@Jims-MacBook-Pro ~ $ sudo chown root:wheel /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
Password:
jimfinucaneDC@Jims-MacBook-Pro ~ $ sudo chmod u+s /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
jimfinucaneDC@Jims-MacBook-Pro ~ $ minishift start
-- Starting profile 'minishift'
-- Check if deprecated options are used ... OK
-- Checking if https://github.com is reachable ... OK
-- Checking if requested OpenShift version 'v3.11.0' is valid ... OK
-- Checking if requested OpenShift version 'v3.11.0' is supported ... OK
-- Checking if requested hypervisor 'xhyve' is supported on this platform ... OK
@jfinucane
jfinucane / gist:79d57c7183f196a47f38b79c9e2ad884
Created January 6, 2019 16:53
Minishift start after successful install
jimfinucaneDC@Jims-MacBook-Pro ~ $ sudo chown root:wheel /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
Password:
jimfinucaneDC@Jims-MacBook-Pro ~ $ sudo chmod u+s /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
jimfinucaneDC@Jims-MacBook-Pro ~ $ minishift start
-- Starting profile 'minishift'
-- Check if deprecated options are used ... OK
-- Checking if https://github.com is reachable ... OK
-- Checking if requested OpenShift version 'v3.11.0' is valid ... OK
-- Checking if requested OpenShift version 'v3.11.0' is supported ... OK
-- Checking if requested hypervisor 'xhyve' is supported on this platform ... OK
@jfinucane
jfinucane / gist:87a8ce6f9289ed2719bf74b6c39bc0dd
Created January 6, 2019 16:53
Minishift start after successful install
jimfinucaneDC@Jims-MacBook-Pro ~ $ sudo chown root:wheel /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
Password:
jimfinucaneDC@Jims-MacBook-Pro ~ $ sudo chmod u+s /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
jimfinucaneDC@Jims-MacBook-Pro ~ $ minishift start
-- Starting profile 'minishift'
-- Check if deprecated options are used ... OK
-- Checking if https://github.com is reachable ... OK
-- Checking if requested OpenShift version 'v3.11.0' is valid ... OK
-- Checking if requested OpenShift version 'v3.11.0' is supported ... OK
-- Checking if requested hypervisor 'xhyve' is supported on this platform ... OK
@jfinucane
jfinucane / lru.rb
Last active November 15, 2018 15:02
LRU wip
class Node
attr_accessor :prev, :next, :value
end
class ListManager
def initialize(capacity)
@capacity = capacity
@used=0
@head = nil
@last =nil
OPEN COMMAND LINE WINDOW
pull current dev: git pull origin dev
create release canddidate branch: git checkout -b 7.12.0.0rc1
git merge origin/test
update changelog.md
update VERSION
push the branch
OPEN BROWSER
go to github icam-public web interface
click on releases
@jfinucane
jfinucane / qualtric.md
Created August 30, 2017 20:50
Qualtrics documentation

Development

Application Controller Code needed for workspace and status callback

include QualtricsInterface (for example in helpers/shut/study_helper.rb)

Set environment variables

ENV['API_URL'}                      ||= 'http://api-assessment.bhtcloud.org/'

ENV['QUALTRICS_ID'] = 'a qualtrics api token'

@jfinucane
jfinucane / gist:c33f48a0263a09cede0c56c63ebbceaf
Last active February 7, 2017 21:47
Average time of day
def fixme x
y=x.split(':')
y[0].to_i + y[1].to_i/60.0 + y[2].to_i/360.0
end
def formatted x
hh = x.to_i
mm_pct = (x - hh) * 60
mm = mm_pct.to_i
ss_pct = (mm_pct - mm) * 60
ss = ss_pct.to_i
=begin
What is the Problem?
Enroll App has about ten roles; the user has asked for twenty.
Authorization to EA functionality would ideally be a separate concern fromt the application
Current authorization is mingled into the app in ad hoc manner.
What is Pundit?'
Policy classes with inheritance
Syntactic sugar grabs current_user
@jfinucane
jfinucane / gist:0e21fc39a13d51970cfb
Created February 24, 2016 19:30
Dental plan results affected by Mongo query syntax
# Snippet illustrates a query on hbx_enrollemnts
# FINDS familes including ones that have ivl dental and employer_sponsored health
families = Family.where(:"households.hbx_enrollments.kind" => "employer_sponsored", :"households.hbx_enrollments.coverage_kind" => 'dental')
puts families.size #36
# FINDS families where the enrollment has coverage_kind='dental' and kind: 'employer_sponsored'
families=Family.where(:'households.hbx_enrollments' =>
{