Skip to content

Instantly share code, notes, and snippets.

View ritcheyer's full-sized avatar
🏠
Working from home

Eric Ritchey ritcheyer

🏠
Working from home
  • E&J Design
  • Lincoln, CA
View GitHub Profile
@ritcheyer
ritcheyer / post-update-slack
Created January 11, 2016 09:20 — forked from dopiaza/post-update-slack
Git post-update commit hook to post a message to a Slack channel. Uses https://gist.github.com/dopiaza/6449505
#!/bin/bash
# This script is designed to be called from a git post-update hook
# Typical usage
# In your post-update hook, the first parameter is the branch ref. So in post-update, you would
# invoke this script something like this:
# /usr/local/bin/post-update-slack $1 <branch to match> <token> <channel>
# The script will only post to slack if the branch being updated matches the one listed as <branch to match>
# Use "any" to match any branch (hopefully you don't have a branch called "any")
LAST_COLOR_ON = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 ]
RETURNING_ON = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 ]
@ritcheyer
ritcheyer / _form.html.erb
Created January 23, 2014 21:28
is this the right way to do this?
<% if @hair_analysis.hair_color_tone.is_primary %>
<%= text_field_tag "hair_color_tone_input", nil, :placeholder => 'Other' %>
<% else %>
<%= text_field_tag "hair_color_tone_input", nil, :placeholder => 'Other', :value => @hair_analysis.hair_color_tone.label %>
<% end %>
def update
did_succeed = @hair_analysis.update(hair_analysis_params)
if did_succeed && params[:hair_analysis][:skin_tone_id].nil?
@new_skin_tone = SkinTone.find_or_create_by(label: skin_tone_params)
@hair_analysis.skin_tone = @new_skin_tone
did_succeed = @hair_analysis.save
end
if condition1 && (condition2.nil? || condition3.nil? || condition4.nil?)
# do stuff
end
$('.main-column').on('click', '[data-action="toggle"]', function () {
var $this = $(this);
// Toggle the appropriate DOM element
switch ($this.data('what')) {
case 'products':
var myBrands = $this.next('.brands');
@ritcheyer
ritcheyer / _site_footer.html.erb
Last active December 31, 2015 21:39
@banderson623 is going to barf all over his keyboard for this one
@ritcheyer
ritcheyer / 0_reuse_code.js
Created September 27, 2013 05:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ritcheyer
ritcheyer / A-Pen-by-Eric-Ritchey.markdown
Created September 19, 2013 21:39
A Pen by Eric Ritchey.
@ritcheyer
ritcheyer / appDetails.html
Created August 28, 2013 18:01
Adding notification for when there's an app that has an update available.
<div class="app" data-appid="5190">
<a href="#my-apps/onboard/app/5190" data-event="launchapp">
<h3 class="app-title">Notepad<i class="app-close icon-remove hide"></i></h3>
<div class="app-content">
<div class="app-logo">
<img src="/assets/vendors/1/img/DefaultApp.png?t=1377711784124" alt="Notepad">
</div>
<p class="app-description"></p>
</div>