Skip to content

Instantly share code, notes, and snippets.

View goldnuggets24's full-sized avatar

Mike Levine goldnuggets24

  • Collectionzz / University of North Carolina
  • Chapel Hill
View GitHub Profile
var n = true;
jQuery('#menu-item-27').click(function() {
n == false; });
jQuery('.iosSlider').iosSlider({
snapToChildren: true,
autoSlide: n,
desktopClickDrag: true,
keyboardControls: true,
autoSlideTimer: 1000,
navNextSelector: jQuery(this).closest('.iosSlider').find('.next'),
@goldnuggets24
goldnuggets24 / gist:6572698
Created September 15, 2013 17:22
Routes.rb - pet_project
PetProject::Application.routes.draw do
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
root 'welcome#index'
resources :fuckelses
# Example of regular route:
@goldnuggets24
goldnuggets24 / gist:6977197
Created October 14, 2013 15:10
This is the controller I'm working with in card_signups (card_signups_controller) I need to add functionality that creates a new 'GiftConversion' class instance for the user when they click on a button in the _social partial.
class CardSignupsController < ApplicationController
before_filter :require_user_sign_up
before_filter :require_unique, :only => [:print_temp_card, :update]
before_filter :get_card_user, :only => [:rewards, :edit, :update, :print_coupon]
before_filter :get_rewards, :only => [:rewards, :print_coupon, :edit]
skip_before_filter :verify_authenticity_token
def index
@first_stupid = CardSignup.new
@goldnuggets24
goldnuggets24 / gist:6978578
Created October 14, 2013 16:47
html source of _social partial in card_signups path
<!DOCTYPE html>
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta content="authenticity_token" name="csrf-param" />
<meta content="2UzX97QcpwTQ9SEM6B8DbYzlQv3CY2F9JdhVu6tYgjs=" name="csrf-token" />
<meta content='text/html;charset=UTF-8' http-equiv='content-type'>
<title>HQchannel</title>
<meta content='[nil, "Local, New Jersey, Promotions, Coupons, Deals, Businesses, telephone, North Jersey"]' name='keywords'>
<meta content='["Your local guide to events, promotions, and every local company near you. We are local search made wonderful."]' name='description'>
@goldnuggets24
goldnuggets24 / gist:6978618
Created October 14, 2013 16:51
Print of _social screen
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><script id="tinyhippos-injected">if (window.top.ripple) { window.top.ripple("bootstrap").inject(window, document); }</script><head>
<meta content="authenticity_token" name="csrf-param">
<meta content="2UzX97QcpwTQ9SEM6B8DbYzlQv3CY2F9JdhVu6tYgjs=" name="csrf-token">
<meta content="text/html;charset=UTF-8" http-equiv="content-type">
<title>HQchannel</title>
<meta content="[nil, &quot;Local, New Jersey, Promotions, Coupons, Deals, Businesses, telephone, North Jersey&quot;]" name="keywords">
<meta content="[&quot;Your local guide to events, promotions, and every local company near you. We are local search made wonderful.&quot;]" name="description">
<meta content="6670644BEAA93299A81158F71F517217" name="msvalidate.01">
<meta content="c89c098960f9f17d" name="y_key">
<meta content="http://www.hqchannel.com/images/refer/hq-card.png" property="og:image">
@goldnuggets24
goldnuggets24 / gist:6978820
Created October 14, 2013 17:09
_social again... lines 36-38 disappear in browser : (
.grid_9
%br
.clear
.grid_7.alpha.omega{:style => "width: 605px;"}
.grid_7.omega
.grid_2
%h1
Almost there ...
.grid_4{:style => "padding-top: 10px;"}
%p
@goldnuggets24
goldnuggets24 / gist:6993385
Created October 15, 2013 15:26
minified js... i added html change to the first part of this... the rest doesn't seem to be running.
:javascript
$(document).ready(function() {$("#fb_share_link").click(function() {$(".go_to_disclaimer").html('Thanks for Sharing').attr('href', $(".go_to_disclaimer").attr('href') + "?shared_user_id=#{current_user.id}")});$("#card_signup_update_area").animate({left: 0}, 1000, function(){$("#social_area").css("left", "-4000px").animate({left: 0}, 1000);});console.log('foobar');});
@goldnuggets24
goldnuggets24 / gist:6994270
Created October 15, 2013 16:19
console debugger...
/Users/mikelevine/Sites/hq_channel/app/controllers/card_signups_controller.rb:139
@card_signup << GiftConversion.new if params[:shared_user_id].present?
[134, 143] in /Users/mikelevine/Sites/hq_channel/app/controllers/card_signups_controller.rb
134 end
135
136 def go_to_disclaimer
137 @card_signup ||= CardSignup.new(params[:card_signup])
138 debugger
=> 139 @card_signup << GiftConversion.new if params[:shared_user_id].present?
@goldnuggets24
goldnuggets24 / gist:6994976
Created October 15, 2013 17:06
gist of request
[5] pry(#<CardSignupsController>)> request
=> #<ActionDispatch::Request:0x007fd4f121a250
@env=
{"GATEWAY_INTERFACE"=>"CGI/1.1",
"PATH_INFO"=>"/card_signups/go_to_disclaimer",
"QUERY_STRING"=>"",
"REMOTE_ADDR"=>"127.0.0.1",
"REMOTE_HOST"=>"localhost",
"REQUEST_METHOD"=>"GET",
"REQUEST_URI"=>"http://localhost:3000/card_signups/go_to_disclaimer",
@goldnuggets24
goldnuggets24 / gist:7637864
Created November 25, 2013 07:54
referred_email.rb
class ReferredEmail < Struct.new(:orig_email)
def perform
# Send to All Card Referrals except for Signups
@deals_count = Deal.all.select{|a|a.vote_score > -3 && a.organization.searchable == true}.count
referrals = (CardReferral.all.map(&:email).map(&:downcase) - CardSignup.all.map(&:email).map(&:downcase)).uniq
email_referrals = orig_email.card_referrals.map(&:email)
referrals = referrals - email_referrals