This file contains hidden or 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
function(activate, options) { | |
// Do some logic | |
window.activationFunctions ||= []; | |
window.activationFunctions.push(function(){ | |
if (window.location == 'free-trial') { | |
activate(); | |
} | |
} | |
} |
This file contains hidden or 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
server { | |
listen 80; | |
server_name pl.honest.dev; | |
location / { | |
root /Users/joelj/projects/honest/project_lawrence; | |
try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby; | |
} | |
location @ruby { |
This file contains hidden or 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
# HTTPS server | |
# | |
server { | |
listen 443 ssl; | |
server_name www.honest.dev; | |
ssl_certificate /usr/local/etc/nginx/ssl/honest.crt; | |
ssl_certificate_key /usr/local/etc/nginx/ssl/honest.key; | |
ssl_session_cache shared:SSL:1m; |
This file contains hidden or 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
server { | |
listen 80; | |
server_name try.honest.dev; | |
client_max_body_size 5M; | |
location / { | |
root /Users/joelj/projects/honest/captain_solo; | |
try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby; | |
} |
This file contains hidden or 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
SELECT replace(users.first_name,',',' ') AS 'FirstName', | |
replace(users.last_name,',',' ') AS 'LastName', | |
users.created_at AS 'SignUpDate', | |
users.cancelled_membership_at AS 'MembershipCancelledDate'," + | |
newsletter_queries + | |
" | |
(SELECT count(orders.id) | |
FROM orders | |
WHERE orders.state in ('charged','staged','pick_started','restaged','vanity_started','shipped','delivered') | |
AND orders.user_id=users.id) as NumberOfOrders, |
This file contains hidden or 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
EMAIL_PREFERENCES = %w[baby_weight_update_requests in_on_and_around_your_baby nursery marketing_email] | |
def wants_email?(email_preference) | |
email_preferences.include?(email_preference.to_s) | |
end | |
def email_preferences=(email_preferences) | |
self.email_preferences_mask = | |
(email_preferences.map!{|p| p.to_s} & EMAIL_PREFERENCES).map { |p| 2**EMAIL_PREFERENCES.index(p) }.sum | |
end |
This file contains hidden or 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
span[data-ng-if="slide.slide_type == 'video'" | |
data-html5-video | |
data-hv-mp4="slide.content.slide_media.platforms.web.mp4.url" | |
data-hv-ogg="slide.content.slide_media.platforms.web.ogg.url" | |
data-hv-webm="slide.content.slide_media.platforms.web.webm.url" | |
data-hv-poster="slide.content.slide_media.platforms.web.cover.url" | |
data-hv-autoplay="true" | |
data-hv-loop="true" | |
data-hv-mute="true" | |
data-hv-controls="false"] |
This file contains hidden or 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
require 'ruby-prof' | |
RubyProf.start | |
render_json( product ) | |
result = RubyProf.stop | |
# | |
# # Print a flat profile to text | |
printer = RubyProf::GraphHtmlPrinter.new(result) | |
printer.print(File.open('/Users/joelj/output.html', 'w+')) |
This file contains hidden or 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
#This function encrypts | |
#returns encrypted card number (if successful) and code | |
chaseEncrypt = (ccNumber, cvv) -> | |
embed = embed_encryption | |
card = {} | |
payment_provider = | |
options: {} | |
if is_pie_encryption_download_error() || is_pie_key_download_error() | |
scribe.log({user_id: user.id, error: 'cant load encryption js'}, 'payments_log', 'payments/credit_card/chase/tokenization/encrypting_card/failure') |
This file contains hidden or 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
setVar = function (variable, callback) { | |
beforeAll(function(){ | |
var value, called = false; | |
var memoizer = function() { | |
if (called) { | |
return value; | |
} else { | |
called = true; | |
} | |