Skip to content

Instantly share code, notes, and snippets.

View priyank-gupta's full-sized avatar

Priyank Gupta priyank-gupta

View GitHub Profile
@priyank-gupta
priyank-gupta / logs.md
Last active July 24, 2018 13:59
Possible server slow issue for usdot verifier

https://staging-goload.konexial.com/support/incoming_api_calls/2237996

Jul 22 16:29:03 :  konexial-k8s-staging-web-104602799-cpr11 | [9dfed5df-27b4-4098-beea-1e284285647e] [staging-goload] Started POST "/api/v1/usdot_verifier" for 127.0.0.1 at 2018-07-22 10:59:02 +0000
Jul 22 16:29:03 :  konexial-k8s-staging-web-104602799-cpr11 | [9dfed5df-27b4-4098-beea-1e284285647e] [staging-goload] Processing by Api::V1::UsdotVerifierController#create as */*
Jul 22 16:29:03 :  konexial-k8s-staging-web-104602799-cpr11 | [9dfed5df-27b4-4098-beea-1e284285647e] [staging-goload]   Parameters: {"usdot"=>"0426201"}
Jul 22 16:29:03 :  konexial-k8s-staging-web-104602799-cpr11 | [9dfed5df-27b4-4098-beea-1e284285647e] [staging-goload]   [1m[36m[master/1] (0.7ms)[0m  [1mBEGIN[0m
Jul 22 16:29:03 :  konexial-k8s-staging-web-104602799-cpr11 | [9dfed5df-27b4-4098-beea-1e284285647e] [staging-goload]   [1m[35m[master/1] SQL (0.9ms)[0m  INSERT INTO "incoming_api_calls" ("created_at", "request_body", "request_headers", "request_method", "
User: Dukerson Dorce 6242 jonathan071774@yahoo.com
API V1
{"date_format"=>nil, "currency_format"=>nil, "time_format"=>nil, "role"=>"owner_operator", "profile_picture"=>{"pic"=>{"url"=>"userpics/default.png", "small"=>{"url"=>"userpics/small.png"}, "w48h48"=>{"url"=>"userpics/w48h48.png"}, "w70h70"=>{"url"=>"userpics/w70h70.png"}, "medium"=>{"url"=>"userpics/medium.png"}, "big"=>{"url"=>"userpics/big.png"}}}, "name"=>"Dukerson Dorce", "login"=>"jonathan071774@yahoo.com", "last_name"=>"Dorce", "language"=>nil, "id"=>6242, "first_name"=>"Dukerson", "email"=>"jonathan071774@yahoo.com", "authentication_token"=>"aNskXoiAzB5iBsRi6sxz", "phone"=>"12398678130", "company_id"=>"jd_transportation_llc", "user_profile_id"=>6953, "carrier_name"=>"JD Transportation LLC", "scac"=>"", "usdot"=>"3106530", "home_terminal_address"=>"5660 BOYNTON BAY CIR \r\nBOYNTON BEACH, FL 33437", "office_terminal_address"=>"5660 BOYNTON BAY CIR \r\nBOYNTON BEACH, FL 33437", "broadcast_user"=>false}
API V2
{"date_format"=>nil, "currency_format
@priyank-gupta
priyank-gupta / commands
Last active August 29, 2015 14:23
Mina Example Script using Roles (in whenever) as used in Capistrano
# Custom file for whenever.rb with roles, https://gist.github.com/priyank-gupta/e15b5dab570e54cde2ee
# to deploy on staging_1
mina deploy on=staging_1
# to update whenever on staging_2
mina whenever:update on=staging_2
# to restart delayed_job on staging_2
mina delayed_job:restart on=staging_2
@priyank-gupta
priyank-gupta / whenever.rb
Created June 27, 2015 11:32
Mina whenever with roles
# # Modules: Whenever
# Adds settings and tasks for managing projects with [whenever].
#
# [whenever]: http://rubygems.org/gems/whenever
#
#
# ## Common usage
# require 'mina/whenever'
#
# task :deploy => :environment do
@priyank-gupta
priyank-gupta / img_coverage.rb
Created September 30, 2013 20:11
Image Coverage in Rails Project
require "fileutils"
image_files = Dir.glob("**/*.jpeg") + Dir.glob("**/*.jpg") + Dir.glob("**/*.png") + Dir.glob("**/*.gif")
data_files = Dir.glob("**/*.rb") + Dir.glob("**/*.html.erb") + Dir.glob("**/*.css") + Dir.glob("**/*.css.erb") + Dir.glob("**/*.js") + Dir.glob("**/*.js.erb")
puts image_files.length.to_s + " images found & " + data_files.length.to_s + " files found to search against"
content = data_files.inject("") { |c, f| c += File.open(f, 'r').read }
#This script may not look for the images that are dynamically generated (using loop etc.)