Skip to content

Instantly share code, notes, and snippets.

View shyammohankanojia's full-sized avatar
💭
RazorOps.com

shyam mohan kanojia shyammohankanojia

💭
RazorOps.com
View GitHub Profile
def register
# if request.post?
if @user =User.find(:first,:conditions =>{:email =>params[:email],:imei =>params[:imei]})
render :xml => { :status => 0, :data => 'Email alredy taken!' }.to_xml
else
@user =User.new
@user.email = params[:email] if params[:email]
@user.password = params[:password] if params[:password]
@user.name = params[:email].split('@')[0]
@user.imei = params[:imei] if params[:imei]
require "prawn"
Prawn::Document.generate("report.pdf") do
10.times do
start_new_page
end
repeat :all do
move_down 50
#config/initializers/carrierwave.rb
CarrierWave.configure do |config|
if Rails.env.production? or Rails.env.development?
config.storage :cloud_files
config.cloud_files_username = "your_username"
config.cloud_files_api_key = "your_key"
config.cloud_files_container = "test"
config.cloud_files_cdn_host = "c0012345.cdnn.cloudfiles.rackspacecloud.com"
def store_dir

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@shyammohankanojia
shyammohankanojia / sidetiq-issue
Last active August 29, 2015 13:57
sidetiq-issue
OS : Ubuntu 12.04
rails version 3.2.17
ruby 2.1.1
gem 'sidekiq', '~> 2.17.7'
gem "kiqstand", "~> 1.1.0" # middleware for Sidekiq for use with Mongoid 3
gem 'sidetiq', '~> 0.5.0'
config/sidekiq.rb
This file has been truncated, but you can view the full file.
Last login: Thu Jul 16 18:42:16 on ttys003
CodeCruxs-MacBook-Pro:y-jobs codecrux$ ls
Gemfile README app/ config/ lib/ sfdc.pem vendor/
Gemfile.lock README.md app.json config.ru log/ spec/
Procfile Rakefile bin/ db/ public/ tmp/
CodeCruxs-MacBook-Pro:y-jobs codecrux$ cd
CodeCruxs-MacBook-Pro:~ codecrux$ cd workspace/codecrux/naukricw_new/
CodeCruxs-MacBook-Pro:naukricw_new codecrux$ ls
Procfile README.md api/ crawler/ requirements.txt
CodeCruxs-MacBook-Pro:naukricw_new codecrux$ cd crawler/
@shyammohankanojia
shyammohankanojia / gist:767187ce2352e51addfa8e364b1f06b8
Last active July 11, 2017 08:13
Quick-Start-With-Argo-and-tugboat-notes
Follow this link
https://gist.github.com/Drunlade/7f3691920e2f02d490723ec6305d9b08
Follow following steps Once you get Argo code
Install Python
> brew install python
Install Snappy
> brew install snappy
Request
===============================================================================================
<Request xmlns="http://www.thermeon.com/webXG/xml/webxml/" referenceNumber="BER20170710114922_0008592" version="2.2500">
  <ResRates>
    <Pickup locationCode="ORX51" dateTime="2017-10-31T14:40:00"></Pickup>
    <Return locationCode="ORX51" dateTime="10000-01-01T00:00:00"></Return>
    <CorpRateID>CTR-NET003</CorpRateID>
    <EstimateType>3</EstimateType>
  </ResRates>
Request
===============================================================================================
<Request xmlns="http://www.thermeon.com/webXG/xml/webxml/" referenceNumber="MOL20170713063231_0623872" version="2.2500">
  <ResRates>
    <Pickup locationCode="KEF50" dateTime="2017-09-27T23:00:00"></Pickup>
    <Return locationCode="KEF50" dateTime="2017-10-08T23:00:00"></Return>
    <Class>IFAR</Class>
    <CorpRateID>CTR-NET001</CorpRateID>
    <EstimateType>3</EstimateType>
"Email teena@y-axis.com - UserToken A4LDMqmaF3Ak0qxZQhWRwQ"
About to send data to SFDC at https://cs60.salesforce.com/services/apexrest/UpdateAuthToken ...
<result>
<total_prospects>1</total_prospects>
<prospect>