Skip to content

Instantly share code, notes, and snippets.


Rakesh.P.D errakeshpd

View GitHub Profile
errakeshpd / gist:a03abd00787b959cb32c
Created Dec 20, 2014
want to replace the (only) the condition when an exception is raised .
View gist:a03abd00787b959cb32c
if cols[1] == 12
this fails when the cols[1] is reading from csv . its considering as string
errakeshpd / gist:5f2c7e247cd3a1370543
Last active Aug 29, 2015
how to write this in rails ORM method ?
View gist:5f2c7e247cd3a1370543
FROM examtypes et
LEFT JOIN categoryexams ce ON = ce.examtype_id
LEFT JOIN categoryexamusers ceu ON = ceu.categoryexam_id
LEFT JOIN categoryusers cu ON = ceu.categoryuser_id
LEFT JOIN users u ON = cu.user_id
errakeshpd / gist:236602e118d1803babd6
Last active Aug 29, 2015
check csv column is nill.
View gist:236602e118d1803babd6
Ruby on rails
This line is a record in the csv file.
4,3,"_ is my _, _d indians are_ _ .",Hint 4,10,1,0,3,"",India,Country,All,sad,,,
we want to check cols[8] is nil, i.e column before India.
errakeshpd / gist:ae92a837baa51d53aaa2
Created Dec 30, 2014
BDD - How want to approach the below scenarios ?
View gist:ae92a837baa51d53aaa2
In our project we are documenting unit test case manually.
And in the previous sprint we implemented a functionality like
Excel/ods/csv -> files
Question importing
Such as
View gist:cc066a9fb670a7d97c9e
Scrum involves:
Initial appointment of a project manager called the "scrum master."
Definition and prioritization of tasks to be done.
Planning sessions for each task.
Daily meetings among teams.
Identification and evaluation of potential project risks and process pitfalls.
Execution of projects in brief, high-intensity, frequent work sessions.
Reviews of progress and evaluations of completed projects.
Openness to constructive criticism and ideas for improvement.
errakeshpd / gist:1d7cd337cc4130868cf0
Last active Aug 29, 2015
command in the scripts
View gist:1d7cd337cc4130868cf0
chmod +x;
cp ../vx/ ../instance/myinstance -r;
mv myinstance.yml ../instance/myinstance/config/ -r;
mv myinstance_sidekiq.yml ../instance/myinstance/config/ -r;
sudo mv myinstance.yml /etc/apache2/sites-available/myinstance-site;
mv myinstance.rb ../instance/myinstance/;
chown group pitadmin:pitadmin../instance/myinstance/ -r
cd ../instance/myinstance/
bundle install&;
rake db:create;
errakeshpd / gist:b884d43b32c8d05c49ef
Created Jan 20, 2015
automatically setup the production instance for the customer if he press a button of a rails application
View gist:b884d43b32c8d05c49ef
we have a "marketinginstance" & "our application ABC"
if any one purchase the application ABC from the marketing instance. automatically want to setup the rails application for them.
A - > purchase application
he choose a domain "railz"
then the task is that
errakeshpd / gist:0f2bd2eb5064b5255fa7
Created Jul 7, 2015
Is there any way to create text fields based on the javascript variable
View gist:0f2bd2eb5064b5255fa7
in a model popup receiving a variable as question type id as '$('#subquestion').val()' based on this value the model popup content have to create
<%@lg = Language.all %>
<% @qs_type = Question.find( javascript value ).question_type %>
<% @lg.each do |n| %>
if ( @qs_type == 11)
matchingtype question two textbox
<%= text_area %>
<%= text_area %>
elsif @qs_type == 3
mutiple choice one textbox.
errakeshpd / gist:83c6fc29f22fe73251d4
Last active Aug 29, 2015
How can specify this ruby code in the lambda section
View gist:83c6fc29f22fe73251d4
How can specify this ".sort_by{ |o| }" in the lambda section
scope :sort_by_recommended, lambda{ }
Just like this :
scope :sort_by_recommended, lambda{ .sort_by{ |o| } }
View code
This is a command line application that allows you to scrape twitter!
import collections
import json
from argparse import ArgumentParser
from datetime import datetime
from os.path import isfile
from json import dump
import logging