Skip to content

Instantly share code, notes, and snippets.

View NimaGhaedsharafi's full-sized avatar

Nima Ghaedsharafi NimaGhaedsharafi

View GitHub Profile
@NimaGhaedsharafi
NimaGhaedsharafi / .bash_profile
Created July 31, 2016 15:28 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@NimaGhaedsharafi
NimaGhaedsharafi / phpunit_indie
Last active June 13, 2017 12:30
Run phpunit individually on test files
for file in tests/*
echo "$file" && phpunit "$file"

Keybase proof

I hereby claim:

  • I am NimaGhaedsharafi on github.
  • I am ngh (https://keybase.io/ngh) on keybase.
  • I have a public key whose fingerprint is 32FA 0EB5 60B8 730B F716 6295 2742 4078 5115 61A4

To claim this, I am signing this object:

@NimaGhaedsharafi
NimaGhaedsharafi / SublimeSettings.json
Last active April 30, 2017 05:52
My Favorite Sublime Settings
{
"always_show_minimap_viewport": true,
"auto_indent": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"find_selected_text": true,
"fold_buttons": true,
"font_face": "Ubuntu Mono",
"font_size": 15,
@NimaGhaedsharafi
NimaGhaedsharafi / gist:e185809e507d50cf4528e4b48ef5f940
Created April 30, 2017 05:53
My Favorite Sublime Keybindings
[
{ "keys": ["super+down"], "command": "goto_definition" },
// PHP Companion
{ "keys": ["super+f", "super+q"], "command": "expand_fqcn" },
{ "keys": ["alt+f", "alt+q"], "command": "expand_fqcn", "args": {"leading_separator": true} },
{ "keys": ["super+f", "super+u"], "command": "find_use" },
{ "keys": ["super+f", "super+i"], "command": "import_namespace" },
{ "keys": ["super+f", "super+i", "super+i"], "command": "implement" },
{ "keys": ["shift+super+down"], "command": "goto_definition_scope" },
{ "keys": ["super+f", "super+c", "super+p"], "command": "insert_php_constructor_property" }
@NimaGhaedsharafi
NimaGhaedsharafi / user.php
Created May 25, 2017 18:03
Normalize Email
/**
* @param $email
* @return string
*/
public function normaliseEmail($email)
{
if (ends_with($email, 'gmail.com')) {
$segments = explode('@', $email);
@NimaGhaedsharafi
NimaGhaedsharafi / gist:29aa6ce7ba9f8d6e33a88f85d420368a
Created November 21, 2017 18:33
Remove local branches easily
git branch -d `git branch --merged | grep -v master`
Step 1:  Download Zookeeper
http://www.apache.org/dyn/closer.cgi/zookeeper/
Step 2:
tar -zxcf zookeeper-3.4.6.tar.gz
cd zookeeper-3.4.6
cd conf
Step 3:
cp zookeeper_sample.cfg zoo.cfg
<?php
$ppl = [
'Mohammad' => [
Carbon::SATURDAY => 0,
Carbon::SUNDAY => 0,
Carbon::MONDAY => 0,
Carbon::TUESDAY => 1,
Carbon::WEDNESDAY => 0
],
@NimaGhaedsharafi
NimaGhaedsharafi / authMiddleware.go
Created March 29, 2020 09:42
Firebase Middleware for Echo framework
package auth
import (
"context"
firebase "firebase.google.com/go"
"github.com/labstack/echo/v4"
"google.golang.org/api/option"
"net/http"
"strings"
)