Skip to content

Instantly share code, notes, and snippets.

View brijeshgpt7's full-sized avatar
🏠
Working from home

Brijesh Gupta brijeshgpt7

🏠
Working from home
View GitHub Profile
@gmaslowski
gmaslowski / cassandra-node2pod.yml
Last active July 18, 2024 14:23
k8s-cassandra-nodeLabel2pod
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cassandra-rackdc
data:
cassandra-rackdc.properties: |
dc= datacenter
rack= RACK
---

Body Language of Love and Dating

Citations for the course on Udemy. Course Link

Citations

  • Aldert Vrij. Detecting Lies and Deceit. (Chichester England: John Wiley & Sons, 2000) 93-100.
  • Mark deTurck, “Training Observers to Detect Spontaneous Deception: Effects of Gender,” Communication Reports 4 (Summer 1991): 81-89.
  • K. Fiedler and I. Walka, “Training Lie Detectors to Use Nonverbal Cues Instead of Global Heuristics,” Human Communication Research 20 (December 1993): 199-223.
  • T. A. Russell, E. Chu, and M. L. Phillips, “A Pilot Study to Investigate the Effectiveness of Emotion Recognition Remediation in Schizophrenia Using the Micro-Expression Training Tool,” British Journal of Clinical Psychology 45 (2006): 579-583.
@chrisberkhout
chrisberkhout / .bash_profile
Created January 25, 2017 14:33
Git aliases taken from oh-my-zsh's git plugin and translated to bash
# git aliases - taken from oh-my-zsh's git plugin and translated to bash
# https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#helpful-aliases-for-common-git-tasks
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
function git_current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
function git_current_repository() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
@brijeshgpt7
brijeshgpt7 / SQL-Movie-Rating.sql
Created December 3, 2016 17:49
My answers to SQL exercises for db-class.org /Part 1/
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(mID int, title text, year int, director text);
create table Reviewer(rID int, name text);
create table Rating(rID int, mID int, stars int, ratingDate date);
@nisanthchunduru
nisanthchunduru / GETTING_STARTED.md
Created June 17, 2016 06:23
Factory Girl 3.2.0 Getting Started Guide

Getting Started

Update Your Gemfile

If you're using Rails, you'll need to change the required version of factory_girl_rails:

gem "factory_girl_rails", "~> 3.0"
@imnithin
imnithin / etc_hosts
Last active August 29, 2015 14:19
etc_hosts
sudo gedit /etc/hosts
127.0.0.1 youtube.com
will redirect to localhost page
@skozz
skozz / devise_authentication_api.rb
Last active January 14, 2025 04:40 — forked from marcomd/gist:3129118
Authenticate your API with Devise gem, token by header. Ruby on Rails 4. Read the comments.
#Session controller provides a token
#/controllers/api/sessions_controller.rb
class Api::SessionsController < Devise::SessionsController
before_filter :authenticate_user!, :except => [:create]
before_filter :ensure_params_exist, :except => [:destroy]
respond_to :json
def create
resource = User.find_for_database_authentication(:email => params[:user_login][:email])
return invalid_login_attempt unless resource
@pratik60
pratik60 / ccavenue_with_rails
Created October 15, 2013 20:34
ccavenue rails
Integrating CCAvenue with Ruby on Rails site
Jul 30 · 2013
At www.dealbuddie.com, we recently had the need to integrate CCAvenue payment gateway to expand our delivery network across India. While CCAvenue provides sample files for php, jsp and C#, it had nothing to offer for rails. Since DealBuddie.com is developed using RoR, I had to build the required solution myself.
Following are quick steps for anybody who wants to do the same -
1) Create the functions required to create and verify your checksum, and add it to application_helper.rb
def verifyChecksum( merchantID, orderID, amount, authDesc, workingKey, checksum)
@ryansobol
ryansobol / gist:5252653
Last active February 23, 2025 06:28
15 Questions to Ask During a Ruby Interview

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.

@sporkd
sporkd / question.rb
Created February 15, 2012 23:33
Using arel matches_any
class Question < ActiveRecord::Base
# UGLY
def self.starts_with(*strings)
# Big loop to build something like this...
where("wording LIKE ? OR wording LIKE ? OR wording LIKE ?", 'blah%', 'blaah%', 'blaaah%')
end
# PURDY
def self.starts_with(*strings)
strings = strings.map { |s| s+'%' }