Skip to content

Instantly share code, notes, and snippets.

View atayebali's full-sized avatar

Anis Tayebali atayebali

View GitHub Profile
@atayebali
atayebali / books.txt
Last active September 28, 2018 16:28
Books I reccomend
Clean Code
Clean Architecture
The pragmatic programmer
Mythical Man Month
Domain Driven Design
Ruby Design Patterns
Eloquent Ruby
Refactoring Ruby
Code Complete
Patterns of Enterprise Applications

Keybase proof

I hereby claim:

  • I am atayebali on github.
  • I am atayebali (https://keybase.io/atayebali) on keybase.
  • I have a public key ASBd6p_Ih6LqP8jCShkBHMfhq88skeW_ZmZabQOlguAo1Qo

To claim this, I am signing this object:

RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@atayebali
atayebali / CR.MD
Last active March 18, 2018 02:30
Code Review Guidelines

What I look for when I do a code review:

FOCUS

  • Methods should do one thing and do that thing well.
  • Name methods and variables well. This is simple to do and most developers mess this up. A name is not a big deal until someone in a hurry needs to get context on a problem fast. For example: handler(), process(), flag, temp, all will only hurt.
  • Methods that group operations together and run them in a specific order should be named appropriately.
  • Each line in a method should do 1 thing.
  • Ternary operations are OK if they are simple and pass the glance test. If someone has to look at the code for more than 1 second to figure out what is going on it should be broken up right away.
  • Keep in mind in prod when a stack trace generates a line and it lands on ternary that is two different cases that will have to be considered. Code should be written such that a glance can yeild high amount of information regarding the issue.
@atayebali
atayebali / flume.sh
Last active October 4, 2017 15:38
Run flume
bin/flume-ng agent --conf conf --conf-file ~/flumelogs.conf --name a1 -Dflume.root.logger=INFO,console
#Spark Streaming.
bin/flume-ng agent --conf conf --conf-file ~/sparkstreamingflume.nf --name a1
# flume.conf
flumelogs.conf: A single-node Flume configuration
# Name the components on this agent
@atayebali
atayebali / pre-commit
Created February 17, 2017 00:17
Make Git scream if the bower.json is incorrect
# This will cause git to stop from letting you commit the wrong bower.json
# Installation Instructions
# Put this script in Classic's .git/hooks folder
# Profit!
BRANCH=`git rev-parse --abbrev-ref HEAD`
MASTER_PATTERN="hyfn8_front_end_assets.git#master"
DEVELOP_PATTERN="hyfn8_front_end_assets.git#develop"
FILE="bower.json"
@atayebali
atayebali / emoji.rb
Last active April 11, 2016 22:27
Emojify Commit messages
#!/usr/bin/env ruby
=begin
Commit messages are serious, too serious. Spice things up with random emojis at the end of a message.
Install this gist:
Download the file and toss it in /usr/local/bin. Rename it to funcommit or fc (if you wanna stay productive)
Change the file permissions so you can execute this bad boy. chmod u-x <name>
Give it a spin.
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@atayebali
atayebali / shell.sh
Last active December 14, 2015 07:29
ps1 prompt
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@atayebali
atayebali / scoreable.rb
Created August 28, 2012 20:09
Nil Guard for total_score. Doing this for weekly too!
def total_score_value
total_score || 0
end