Skip to content

Instantly share code, notes, and snippets.

View themsaid's full-sized avatar
🚴‍♂️
Just paddling

Mohamed Said themsaid

🚴‍♂️
Just paddling
View GitHub Profile
@themsaid
themsaid / .bashrc
Last active April 9, 2016 09:41
My .bashrc file
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# get the git branch .. from https://gist.github.com/wolever/6525437
gitbranch() {
export GITBRANCH=""
local repo="${_GITBRANCH_LAST_REPO-}"
View ConfigManager.php
<?php
namespace App\Console\Commands;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Console\Command;
use Illuminate\Support\Arr;
class ConfigManager extends Command
{
View test.php
<?php
function(){
echo "Hello";
}
@themsaid
themsaid / openpr.sh
Created August 21, 2017 10:59
open PR from the current branch
View openpr.sh
function openpr() {
br=`git branch | grep "*"`
repo=$1
parentBranch=$2
open -a /Applications/Google\ Chrome.app https://github.com/${repo/* /}/compare/${parentBranch/* /}...themsaid:${br/* /}\?expand\=1
}
@themsaid
themsaid / vueSelect2.js
Created November 17, 2015 11:41
Wrapping the select2 plugin into a Vue.js custom directive.
View vueSelect2.js
Vue.directive('select', {
twoWay: true,
priority: 1000,
params: ['options'],
bind: function () {
var self = this;
$(this.el)
View gist:81c73aa7c4fd2ab89ab430624f78e9ef
machine:
pre:
- sudo apt-get update; USE_PRECOMPILE=true sudo -E circleci-install php 7.1.0
php:
version: 7.1.0
dependencies:
override:
- composer install --no-interaction
@themsaid
themsaid / gist:92dc313ffda506f0f0f3f295ed66a64b
Last active May 2, 2018 14:44
Delete all branches except
View gist:92dc313ffda506f0f0f3f295ed66a64b
// Delete all except multiple
git branch | grep -v "master\|dev" | xargs git branch -D
// Delete all except 1
git branch | grep -v "master" | xargs git branch -D
View pushme
function pushme {
br=`git branch | grep "*"`
git add --all
if (($# > 1)); then
params=''
for i in $*;
do
@themsaid
themsaid / pagination.blade.php
Created April 21, 2017 12:57
Pagination view for UIkit
View pagination.blade.php
@if ($paginator->hasPages())
<ul class="uk-pagination">
@if ($paginator->onFirstPage())
<li class="uk-disabled"><a href="#"><span uk-pagination-previous></span></a></li>
@else
<li><a href="{{ $paginator->previousPageUrl() }}"><span uk-pagination-previous></span></a></li>
@endif
{{-- Pagination Elements --}}
@foreach ($elements as $element)
@themsaid
themsaid / HasEnums.php
Last active August 29, 2020 23:23
PHP Enumerated Type
View HasEnums.php
trait HasEnums
{
/**
* The array of enumerators of a given group.
*
* @param null|string $group
* @return array
*/
static function enums($group = null)
{