Skip to content

Instantly share code, notes, and snippets.

View kleinjm's full-sized avatar

James Klein kleinjm

View GitHub Profile
@kleinjm
kleinjm / bundler_cache_miss.txt
Created February 18, 2023 00:45
bundler_cache_miss
2023-02-17T22:52:23.4623673Z ##[group]Run ruby/setup-ruby@v1
2023-02-17T22:52:23.4624019Z with:
2023-02-17T22:52:23.4624309Z bundler-cache: true
2023-02-17T22:52:23.4624664Z ruby-version: default
2023-02-17T22:52:23.4624967Z env:
2023-02-17T22:52:23.4625609Z BUNDLE_GEMS__CONTRIBSYS__COM: ***
2023-02-17T22:52:23.4626119Z BUNDLE_GITHUB__COM: x-access-token:***
2023-02-17T22:52:23.4626499Z RAILS_ENV: test
2023-02-17T22:52:23.4626958Z BUNDLE_WITHOUT: development:production
2023-02-17T22:52:23.4627359Z RAILS_MASTER_KEY: ***
@kleinjm
kleinjm / generate.rb
Last active May 3, 2019 14:06
Number multiplier
# frozen_string_literal: true
def generate(number)
split_digits = number.to_s.chars.map(&:to_i)
split_digits.inject(0) { |sum, digit| sum + digit**2 }
end
def test_generate
test_cases = {
0 => 0,
@kleinjm
kleinjm / MyComponent1.spec.js
Created January 18, 2018 20:16
Test components and examples for VueJS L&L
import { shallow } from 'vue-test-utils';
import MyComponent from '~src/packages/profiles/components/MyComponent1.vue';
describe('MyComponent', () => {
describe('rendering items', () => {
it('renders all items in the list', () => {
const wrapper = shallow(MyComponent, {
propsData: {
users: [
{ id: 1, name: 'First' },
@kleinjm
kleinjm / html_erb_to_haml.sh
Created October 24, 2016 13:23
Converts all files in a project directory to .html.haml from .html.erb
#!/bin/bash
gem install html2haml
find . -name \*.erb -print | sed 'p;s/.erb$/.haml/' | xargs -n2 html2haml
find . -type f -name '*.html.erb' -delete
@kleinjm
kleinjm / activerecord.yml
Last active February 15, 2018 11:35
ActiveRecord locales (.yml) for Mongoid attribute validations
# config/locales/activerecord.yml
# Custom error messages for ActiveRecord and Mongoid Document validations.
#
# For a full list of validation options, see:
# http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models
en:
activerecord:
errors:
models: