Skip to content

Instantly share code, notes, and snippets.

View zerothabhishek's full-sized avatar

Abhishek Yadav zerothabhishek

View GitHub Profile
@zerothabhishek
zerothabhishek / git-process.md
Last active March 25, 2016 17:56
A git process I like

A Git process

  • Developer creates a new branch for every bug-fix or feature
  • Feature branch is always created from master
  • Developer watches master branch for changes. If another team member updates the master, she updates feature branch too.
  • Feature branches are updated using rebase, not by merging
  • Developer deploys the feature branch for demo/QA
  • Another team member reviews code in the feature branch
  • After demo and review passes, developer squash-merges the feature branch in her master, and pushes to the origin master
  • For production-deployment, developer sets a tag on the origin/master, and deploys using the tag
@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
@zerothabhishek
zerothabhishek / agenda.md
Last active July 10, 2016 05:03
FizzBuzz Agenda

The workshop shall be a series of lectures and coding sessions (mentioned as Practical here)

Session-1: Basics

  • Lecture:
    • variables
    • Branching
    • puts, p
    • Define a method
  • IRB
@zerothabhishek
zerothabhishek / partial-calculator.rb
Last active June 23, 2016 12:15
The partial calculator problem I used in interviews
#
# We have something called a PartialCalculator in the code
# for calculating some health related parameters.
#
# The PartialCalculator works like this -
#
# - take an input hash
# - merge the given data with some standard values
# - calls a FullCalculator with the values (in the overall method)
#
@zerothabhishek
zerothabhishek / read-times-large-values.markdown
Last active January 18, 2017 04:40
read times for large key values - Memcache and Redis

Memcache

Server: Ubuntu 16.04.1
Client: Ubuntu 16.04.1, Ruby 2.3 client (Dalli)
Memcache version: 1.4.25
Config changes:

  • Changed bind setting to allow external connections

Client code:

class FacilitiesServicesForm
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
# These are sort of like the has_many relation
attr_accessor :facilities_offerred,
:services_offerred
@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);
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org 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 / how-to-reach-1.md
Last active July 1, 2017 06:43
How to Reach: Real Image Media

Address:

Real Image Media Technologies
42, Dr Ranga Rd, Marwadi Thottam, Narasimahapuram, Chennai

Map: google-map

Nearby train stations: Thirumailai MRTS, Mandaveli MRTS
Nearby bus stops: Luz corner, Eldam Road
Landmarks: Kritilals Jwellery, Nageshware Rao park

@zerothabhishek
zerothabhishek / Job | Ionic-React Native Freelancer
Last active July 10, 2017 04:59
Job-post | Ionic/React Native Freelancer
I am looking for someone who can develop application using Ionic/React Native,
I am looking for a full time freelancer who could deliver work with in 15 or 20 days maximum.
Required skills
- Should have developed atleast 5 applications using Ionic/React Native
- Should be able to refine the UI screens,
- Should have exposure to security standards.
- Should write test cases and test the application throughly.
- Good to have knowledge in cloud servers like AWS.