Skip to content

Instantly share code, notes, and snippets.

View abdolrhman's full-sized avatar
:electron:
Knowing!

Abdulrahman Moahmed abdolrhman

:electron:
Knowing!
View GitHub Profile
The difficult I do immediately, the impossible takes a little bit longer.
$randomCode = bin2hex(openssl_random_pseudo_bytes(30));
factory('App\User', 10)->create();
That's always been my approach, at least. If I needed to filter results, I would have a chainable method on my repository that would apply a relatively simple key-value filter. This trait is ripped directly from a current project:
trait FilterableTrait
{
protected $validFilterableFields = [];
protected $filters = [];
protected function addFilter($field, $value)
@abdolrhman
abdolrhman / git rebase
Created June 23, 2018 18:59
git rebase
After changes committed to your branch, checkout master and pull to get the changes from the repo:
git checkout master
git pull origin master
Then checkout your branch and rebase your changes on master :
git checkout RB
git rebase master
or last two commands in one line:
@abdolrhman
abdolrhman / The Technical Interview Cheat Sheet.md
Created September 6, 2019 15:57 — forked from tsiege/The Technical Interview Cheat Sheet.md
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.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo since a gist is too difficult to maintain as an open source endevaor and there is no way to version it. I have updated below, but I will not be able to keep this one up to date so please checkout the repo instead. The below is just for some preservation for those who stumble across here.






\

@abdolrhman
abdolrhman / README-Template.md
Created September 8, 2019 14:45 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@abdolrhman
abdolrhman / Aggregate functions.md
Created October 3, 2019 08:29
[MySQL] snippets for mysql #snippets #mysql

Select but without duplicates

SELECT distinct name, email, acception FROM owners WHERE acception = 1 AND date >= 2015-01-01 00:00:00

Calculate total number of records

SELECT SUM([column]) FROM [table];

Count total number of [column] and group by [category-column]

@abdolrhman
abdolrhman / CopyCatSolution.md
Last active June 19, 2022 22:00
CopyCat Problem architecture solution

Problem:

  • externalize strings of file into a seprate file
  • each time a merge is made
  • a request needs to be made Automatically
    • create a seprate PR
    • pulls all strings from the commited files
    • create random variables names for each of these strings
    • push them in a seprate predefine file
    • replace the strings on the commited files with the generated random variables that are on the predefine file