Skip to content

Instantly share code, notes, and snippets.

View PritiKumr's full-sized avatar

Preethi Krishnamoorthy Ramesh Kumar PritiKumr

View GitHub Profile
class Controller
include LazyLoad
def show
@model = Model.find(...)
respond_to do |format|
format.html do
@html_specific_data = Model.find(...)
end
$(function() {
function split( val ) {
return val.split( /,\s*/ );
}
function extractLast( term ) {
return split( term ).pop();
}
$( "#new_interest" ).autocomplete({
@PritiKumr
PritiKumr / install.sh
Created May 11, 2017 11:35 — forked from ziadoz/install.sh
Install ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Remove existing downloads and binaries so we can start from scratch.
rm ~/google-chrome-stable_current_amd64.deb
@PritiKumr
PritiKumr / capybara cheat sheet
Created May 11, 2017 11:48 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
{
"Name": "sample string 1",
"EqTypeDesc": "sample string 2",
"Current_Meter_Hours": 33,
"LTD_Meter_Hours": 4,
"EngineMake": "sample string 5",
"EngineModel": "sample string 6",
"EngineSN": "sample string 7",
"EngineDescription": "sample string 8",
"FuelType": "sample string 9",
{
"Trip": "sample string 1",
"Driver1": "sample string 2",
"Driver2": "sample string 3",
"Tractor": "sample string 4",
"Trailer": "sample string 5",
"CostCenter": "sample string 6",
"Division": "sample string 7",
"ShipperCode": "sample string 8",
"ShipperName": "sample string 9",
{
"Status": 1,
"DriverName": "sample string 2",
"DriverCode": "sample string 3",
"VehicleNumber": "sample string 4",
"DataDate": "sample string 5",
"DataTime": "sample string 6",
"RecordDateTime": "2018-12-07T15:48:51.1891584-06:00",
"CoDrivers": "sample string 8",
"ShippingInfo": "sample string 9",
{
"Type": "sample string 1",
"EqDescription": "sample string 2",
"Current_Meter_Days": 3,
"LTD_Meter_Days": 4,
"KingPinSetting": 5,
"Capacity": 6,
"TareWeight": 7,
"AxleCapacity": 8,
"AxleSpacing": 9,
{
"Type": "sample string 1",
"EqDescription": "sample string 2",
"CabSN": "sample string 3",
"TruckColor": "sample string 4",
"Current_Meter_Miles": 5,
"LTD_Meter_Miles": 6,
"WheelBase": 7,
"Capacity": 8,
"TareWeight": 9,