Skip to content

Instantly share code, notes, and snippets.

View zerothabhishek's full-sized avatar

Abhishek Yadav zerothabhishek

View GitHub Profile

Questions to ask potential employers

  • How long do you expect it would take me to deploy my first change? To become productive? To understand the codebase?
  • What kind of equipment will I be provided? Will the company pay/reimburse me if I want something specific?
  • What's the longest tenure of a developer at this company?
  • How long has the top quarter of the developers been here?
  • What fraction of the developers have been here less than 6 months?
  • How long does it take to do a complete deployment?
  • How large are PRs? For a "big" PR, how many lines of code? How long is it open?
  • About what fraction of their time are developers given (implicitly or explicitly) the freedom to explore?
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by [email protected] http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@zerothabhishek
zerothabhishek / distance.sql
Created February 12, 2017 10:59 — forked from aramonc/distance.sql
MySQL function to calculate the distance between two coordinates using the Haversine formula. Leaving it here for future reference.
DELIMITER $$
CREATE FUNCTION `haversine` (lat1 DECIMAL(8,6), lng1 DECIMAL(8,6), lat2 DECIMAL(8,6), lng2 DECIMAL(8,6)) RETURNS DECIMAL(8,6)
BEGIN
DECLARE R INT;
DECLARE dLat DECIMAL(30,15);
DECLARE dLng DECIMAL(30,15);
DECLARE a1 DECIMAL(30,15);
DECLARE a2 DECIMAL(30,15);
DECLARE a DECIMAL(30,15);
DECLARE c DECIMAL(30,15);
@zerothabhishek
zerothabhishek / db.rake
Created May 11, 2016 05:35 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd