A Pen by Eric Ritchey on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% 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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if condition1 && (condition2.nil? || condition3.nil? || condition4.nil?) | |
# do stuff | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |