Skip to content

Instantly share code, notes, and snippets.


Jatin Ganhotra jatinganhotra

View GitHub Profile
jatinganhotra / sparklistener-checkpointing.scala
Created Nov 9, 2015
SparkListener - Checkpointing jobs
View sparklistener-checkpointing.scala
import scala.collection.JavaConversions._ // for propertiesAsScalaMap function
sc.addSparkListener(new SparkListener() {
override def onJobStart(jobStart: SparkListenerJobStart) {
println("ADAPT: INSIDE Job Start Listener ");
var props = propertiesAsScalaMap(
if (props.contains("spark.rdd.scope"))
val propsMap = // Convert props to propsMap
if ( propsMap.contains("name") && propsMap("name") == "checkpoint")
jatinganhotra / The Technical Interview Cheat
Last active Aug 25, 2015 — forked from TSiege/The Technical Interview Cheat
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
jatinganhotra / difffile_file_names.txt
Created Nov 26, 2014
Issue in ruby-git - Inconsistency with Diff contents
View difffile_file_names.txt
jatinganhotra / Octave install error
Created Apr 1, 2014
'brew --config', 'brew doctor' and 'brew install octave' logs
View Octave install error
bash-3.2$ brew --config
HEAD: 7b68e440f1626fc17a33afb2784404139cafd24c
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.9.2-x86_64
Xcode: 5.1
jatinganhotra / gist:8509597
Created Jan 19, 2014
brew status info (Trouble installing octave 3.8.0 on OS X Mavericks 10.9.1)
View gist:8509597
-> brew doctor
bash-3.2$ brew doctor
Your system is ready to brew.
-> brew --config
bash-3.2$ brew --config
HEAD: b51461cb280581aa6fb197229912f79a850f9dad
jatinganhotra / brew status info
Last active Jan 2, 2016
brew doctor, brew --config and brew install -v foo 2>&1 Information
View brew status info
-> brew doctor
bash-3.2$ brew doctor
Your system is ready to brew.
-> brew --config
bash-3.2$ brew --config
HEAD: 5dea7fc768fb1c1fba875332f9002378157e5286
jatinganhotra / integral_type_sizes.cpp
Created Dec 24, 2012
C++ snippet to list MIN, MAX values & other attributes of Integral Types
View integral_type_sizes.cpp
#include <iostream>
#include <limits>
using namespace std;
int main()
cout << "Size of size_t = " << sizeof(std::size_t) << endl << endl;
cout << "Minimum value for bool: " << numeric_limits<bool>::min() << endl;
jatinganhotra / Master.h
Created Nov 25, 2012
Use forward declarations in C++ in all the following cases:
View Master.h
class Master {
// Declare a member to be a pointer or a reference to the incomplete type
Forward *ptr1;
Forward &ptr2;
// Declare functions or methods which accepts/return incomplete types:
void ByValue(Forward by_value);
jatinganhotra / Master.h
Created Nov 25, 2012
Can't use forward declarations in C++ in all the following cases:
View Master.h
// Use it as a base class
class Master : Forward {} // compiler error!
// Use it to declare a member:
class Master {
Forward cannot_define_obj_member; // compiler error!
// Define functions or methods using the incomplete type
void SomeFunc1(Forward x) {} // compiler error!
jatinganhotra / rspec-syntax-cheat-sheet.rb
Created Jul 7, 2011 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
View rspec-syntax-cheat-sheet.rb
# RSpec 2.0 syntax Cheet Sheet by
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
You can’t perform that action at this time.