Skip to content

Instantly share code, notes, and snippets.

Zeeshan Gulzar zeeshangulzar

Block or report user

Report or block zeeshangulzar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:a627a3f7b26fdf53c86b4c4f35367afc
intercom.users.create(
user_id: 'sample_intercom_stuff_1',
email: user.email,
name: user.name,
phone: user.phone,
signed_up_at: user.created_at_utc,
# last_seen_ip: user.current_sign_in_ip, # this gets set to aws IP if we push from here so we're turning this off for now.
custom_attributes: {
role: user.role_i18n,
referrer: user.referrer,
@zeeshangulzar
zeeshangulzar / shared test controller update logs
Created Nov 27, 2018
shared test controller update logs
View shared test controller update logs
Started PATCH "/en/tests/752856" for 127.0.0.1 at 2018-11-27 10:06:28 +0500
(1.6ms) SELECT "companies"."subdomain" FROM "companies" WHERE "companies"."deleted_at" IS NULL AND ("companies"."subdomain" IS NOT NULL)
Company::CompanyType Load (1.2ms) SELECT "company_company_types".* FROM "company_company_types" WHERE "company_company_types"."deleted_at" IS NULL AND "company_company_types"."style" = $1 LIMIT $2 [["style", 1], ["LIMIT", 1]]
(1.1ms) SELECT "companies"."subdomain" FROM "companies" WHERE "companies"."deleted_at" IS NULL AND "companies"."company_type_id" = 2 AND ("companies"."subdomain" IS NOT NULL)
Processing by TestsController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"spFP0lUe9jtx4PshcwQLqOtV+uN3tHQUi/NSzGncauvpjscOuYSWvHvpWB3Z+qeDC83N4kaaBwdU9eZwROuIow==", "device_id"=>"", "url"=>"aHR0cDovL2xvY2FsaG9zdDozMDAwL2VuL2N1c3RvbWVycy8yMTA5\r\n", "test"=>{"device_status"=>"existing_device", "replaced_device_serial"=>"", "gauge_id"=>"gid://ccc/Gauge/966", "check1_psi"=>""
View payment_mailer_spec.rb
require 'rails_helper'
describe PaymentMailer do
let!(:admin) { create(:user, :admin, email: 'abc@example.com') }
let!(:sale) { create(:stripe_sale, :with_product, :errored, email: 'abc@example.com', owner: admin.company.subscription) }
let!(:invalid_sale) { create(:stripe_sale, :with_product, :errored, email: 'abc1@example.com') }
before(:each) do
ActionMailer::Base.deliveries.clear
end
View gist:71bdaeb6c510da20e900b5a70ec047a8
# Simple approach to sending email from the Rails console
# Implementation idea courtesy of Steve Klabnik
# http://blog.steveklabnik.com/posts/2012-09-09-random-ruby-tricks--class-new
# Create the mailer class with a block and assign to a variable
mailer = Class.new(ActionMailer::Base) do
def example_message
mail(to: "test@test.com", from: "test@test.com", subject: "Example Message") do |format|
format.text { render text: "Example message body" }
end
View Close.io DEV-764( Incorrect Subscriber Companies)
m = leads_gist
leads = m.map {|k| k[:lead_id]}.uniq
leads.each do |lead|
client.update_lead(lead, { status: 'Trial Expired' })
p "*"*100
p "lead updated #{lead}"
end
@zeeshangulzar
zeeshangulzar / gist:8cd45d26ba6582132e0f7ccb659549b6
Created May 24, 2018
DEV-764( Incorrect Subscriber Companies)
View gist:8cd45d26ba6582132e0f7ccb659549b6
[{:company_name=>"Jaytech Plumbing", :lead_id=>"lead_JDLSuHuQ6DDsiUb4VQ9GwzmViojReM6klQixp2X4GYG"}, {:company_name=>"GreenWorks Backflow", :lead_id=>"lead_RpefsuMai6q20d62R1eY69W2jHCF8o08Oc7jZcrE4fg"}, {:company_name=>"Town of Andrews", :lead_id=>"lead_TgnwcHkSnfuilRHwvKI3TihLBcZQvBkXz8Ivk8fsGvl"}, {:company_name=>"Wettaps, Inc", :lead_id=>"lead_D6WXVzKJRNU6qa0PAmlRkrhXBYm32F5UBh5KaN1KlMs"}, {:company_name=>"PRECISE BACKFLOW N DRAIN CLEANING INC", :lead_id=>"lead_UIe1vJ4r2sKgnu74pZYR5N4SSCVRVyxBbEVKCD4HP6k"}, {:company_name=>"SEEN Plumbing", :lead_id=>"lead_YH9GnGqIb2Xp0bJlE37QYS2EqdwzgTdpg7VcVCmcOtu"}, {:company_name=>"Big Backflow Testers", :lead_id=>"lead_UKh9OpEy3Ly3nZvdHobR8t53Gjf0yHTnPHYAt09PCK3"}, {:company_name=>"Noel Petts Plumbing", :lead_id=>"lead_BYe8P1xVn0uV7yazUYsx25yeGzEGtQUnx6a3IJLbZmV"}, {:company_name=>"North Perry Avenue Water District", :lead_id=>"lead_id6xQuA6DM2DM5y5TdEheZ5LryZwLQl0B6stJ6ihr0C"}, {:company_name=>"Mmb contractors", :lead_id=>"lead_UVjM70rFIfMLv3vlENPBtwCwh4wFag9Wpfrtlpx8n
@zeeshangulzar
zeeshangulzar / gist:8deeafdf863140c2d6b8371256dc859e
Created Apr 3, 2018
C3-DEV-267 Company(name: Student, id: 35, subscription_stripe_id: sub_9OVbkRSO87MRNQ,) Plan.name = 'Free'
View gist:8deeafdf863140c2d6b8371256dc859e
I, [2018-03-16T14:30:48.417855 #17393] INFO -- : [2018-03-16 21:30:48 UTC] [52.46.17.98] method=POST path=/payola/events/ format=xml controller=stripe_event/webhook action=event status=200 duration=157.30 view=0.00 db=40.00 uid= params={"id"=>"evt_1C6Q8PB8Q2UXNoRzstVCcpSc", "object"=>"event", "api_version"=>"2015-10-16", "created"=>1521235845, "data"=>{"object"=>{"id"=>"sub_9OVbkRSO87MRNQ", "object"=>"subscription", "application_fee_percent"=>nil, "billing"=>"charge_automatically", "billing_cycle_anchor"=>1479331402, "cancel_at_period_end"=>false, "canceled_at"=>nil, "created"=>1476739402, "current_period_end"=>1523913802, "current_period_start"=>1521235402, "customer"=>"cus_9OVbtDLuwjPVjL", "days_until_due"=>nil, "discount"=>nil, "ended_at"=>nil, "items"=>{"object"=>"list", "data"=>[{"id"=>"si_195iZqB8Q2UXNoRz3DViS0IR", "object"=>"subscription_item", "created"=>1476739403, "metadata"=>{}, "plan"=>{"id"=>"free", "object"=>"plan", "amount"=>0, "created"=>1476739353, "currency"=>"usd", "interval"=>"month", "int
View response.txt
{"data":{"request_id":"55UI95L4rB3m7SMc","target_type":"profile","messages":[{"target":{"profile":{"criteria":[{"key":"productsArray","scope":"LocalyticsApplication","type":"int","op":"in","values":[[2223,723]]},{"key":"brandsArray","scope":"LocalyticsApplication","type":"int","op":"not_in","values":[134]},{"key":"brandsArrayLocalized","scope":"LocalyticsApplication","type":"string","op":"not_in","values":["134:Kuwait"]},{"key":"locality","scope":"LocalyticsApplication","type":"string","op":"in","values":["Kuwait"]},{"key":"language","scope":"LocalyticsApplication","type":"string","op":"in","values":["ar"]},{"key":"push_disabled","scope":"LocalyticsApplication","type":"string","op":"in","values":["false"]}],"op":"and"}},"alert":"\u0639\u0631\u0636 \u062c\u062f\u064a\u062f \u0645\u0646 \u0627\u0644\u0639\u0644\u0627\u0645\u0629 \u0627\u0644\u062a\u062c\u0627\u0631\u064a\u0629 \u0643\u064a\u0627 \u0644\u0644\u0645\u0646\u062a\u062c \u0627\u0644\u0630\u064a \u062a\u062a\u0627\u0628\u0639\u0647","ios":{"sound":"d
View Rspec Sample code
require 'rails_helper'
describe "S9 Study Detail", :type => :feature do
include PauseHelpers
include UiHelpers
include UserAccountHelpers
include AuditHelpers
include WaitForAjaxHelper
@zeeshangulzar
zeeshangulzar / sidekiq.service
Last active Jan 22, 2018
Sidekiq as a service for Cent OS/ Ubuntu
View sidekiq.service
# cd /usr/lib/systemd/system
[Unit]
Description=sidekiq1
After=syslog.target network.target
[Service]
Type=simple
WorkingDirectory=/var/www/vhosts/lakeproguides.com/staging.lakeproguides.com
You can’t perform that action at this time.