Skip to content

Instantly share code, notes, and snippets.

View aravindgd's full-sized avatar
👾
blip blip

Aravind Gopalakrishnan aravindgd

👾
blip blip
View GitHub Profile
@aravindgd
aravindgd / Plan for 20.1.md
Last active January 26, 2024 09:20
Plan for 20.1

Get together and Warm up (12–12:20)

Drills (12:20 to 13)

  1. 1 on 1 throws (12:20 to 12:30)
  2. 7 cut drill (12:35 to 12:55)

Focused Games (13 to 14:00) - breaks in between as per coaches discretion

#!/bin/bash
HAS_STAGED_RUBY_OR_RAKE_FILES=`git diff --name-only --cached | xargs ls -1 2>/dev/null | grep '\.rb\|\.rake$'`
if [ -z "$HAS_STAGED_RUBY_OR_RAKE_FILES" ]; then
echo -e "No ruby or rake files to lint"
else
echo -e "[RUBOCOP] --> init"
FAILS=`bundle exec rubocop | grep 'no offenses detected' -o | awk '{print $1}'`
def change
create_table(:users) do |t|
## Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: true
# API AUTH
t.string :authentication_token
## Recoverable
$("#ticket_id_select").select2
width: "150px"
multiple: true
placeholder: "Search for a ticket with id"
minimumInputLength: 1
ajax: # instead of writing the function to execute the ticket we use Select2's convenient helper
url: "/list_ticket_id"
dataType: "json"
data: (term, page) ->
page: page
module ApplicationHelper
def bootstrap_class_for(flash_type)
case flash_type
when "success"
"alert-success" # Green
when "error"
"alert-danger" # Red
when "alert"
"alert-warning" # Yellow
when "notice"
%li
%label Employees:
-# = select_tag "",options_for_select(Agent.all.collect{ |u| [u.name, u.id]},ticket.agent.id),class: "chosen-select-last-column agent_val_ajax_change ticket-last-column-chosen-select",data:{ticket: ticket.id}
-# = best_in_place Employee, :name, :type => :select, :collection => @employees.map{|x| [x.user.first_name,x.id]}
- if ticket.employee
= "#{ticket.employee.user.first_name or ticket.employee.id} #{ticket.employee.user.last_name or ticket.employee.id}"
- else
-"-"
%li
@aravindgd
aravindgd / uploadingcsvinrails
Created June 30, 2014 13:36
Uploading CSV rails
namespace :lawyer_city do
desc "Import lawyer data"
task :all => :environment do
import_lawyer_personal_date
end
def import_lawyer_personal_date
records = []