Skip to content

Instantly share code, notes, and snippets.

$(document).on('click', function(e){
if ($(e.target) == $('.learn-more-btn')){
console.log('yo, they're the same element!')
});
SELECT ordered_posts.vote_score as vote_score,(CASE WHEN current_user_subscriptions.user_id IS NULL THEN '0' ELSE '1' END) as user_is_following, ordered_posts.influencer_id, current_user_subscriptions.user_id
FROM (SELECT * FROM posts ORDER BY vote_score desc) as ordered_posts
LEFT OUTER JOIN
(SELECT * FROM influencer_subscriptions WHERE user_id = 1) AS current_user_subscriptions
ON ordered_posts.influencer_id = current_user_subscriptions.influencer_id
WHERE ordered_posts.community_board = TRUE
GROUP BY influencer_id
ORDER BY user_is_following desc, ordered_posts.created_at desc
$(document).ready ->
$('.thing').click (e)->
specialVariable = (some stuff for calculating the variable here)
#function I want to run
someFunction(special_variable)