Skip to content

Instantly share code, notes, and snippets.

well caffeinated

mohammed osama secmohammed

well caffeinated
View GitHub Profile
secmohammed /
Created Apr 3, 2020 — forked from antirez/
RESP3 protocol draft

RESP3 specification

Versions history:

  • 1.0, 2 May 2018, Initial draft to get community feedbacks.


The Redis protocol has served us well in the past years, showing that, if carefully designed, a simple human readable protocol is not the bottleneck in the client server communication, and that the simplicity of the design is a major advantage in creating a healthy client libraries ecosystem.

Yet the Redis experience has shown that after about six years from its introduction (when it replaced the initial Redis protocol), the current RESP protocol could be improved, especially in order to make client implementations simpler and to support new features.

secmohammed / structs_interface.go
Created Jan 21, 2020 — forked from josephspurrier/structs_interface.go
Golang - Understand Structs and Interfaces
View structs_interface.go
// Also available at:
package main
import (
// *****************************************************************************
// Example 1 - Struct vs Struct with Embedded Type
secmohammed / ResolverWithMutation.ts
Created Aug 11, 2019
type-graphql validating inputs using yup instead of class-validator
View ResolverWithMutation.ts
const validationSchema = yup.object().shape({
email: yup
.min(3, emailNotLongEnough)
password: yup
secmohammed / .zshrc
Last active May 6, 2019
zsh configuration
View .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/mohammed/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See
secmohammed / gist:d2aeeee9ba18b68b8ec56cfd02b2e9c4
Last active Mar 10, 2019
How do I force “git pull” to overwrite local files?
View gist:d2aeeee9ba18b68b8ec56cfd02b2e9c4
First do a commit of your changes
git add *
git commit -a -m "local file server commit message"
Then fetch the changes and overwrite if there is a conflict
git fetch origin master
git merge -s recursive -X theirs origin/master
secmohammed /
Last active Mar 5, 2019
laravel exists rule validation
  • when using the Rule class to check on existence of specific record while validation , a query builder is being returned that can be used for nested checks
Rule::exists('addresses', 'id')->where(function($builder) {
  $builder->where('user_id', auth()->id());

That's an alternative to creating a couple of "exists" rule like the following: