Skip to content

Instantly share code, notes, and snippets.

🚴‍♂️
Just paddling

Mohamed Said themsaid

🚴‍♂️
Just paddling
View GitHub Profile
View controller.md

require "stil/gd-text": "^1.1",

class ControllerClass extends Controller
{
    public function __invoke($slug)
    {
        $post = WinkPost::where('slug', $slug)->first();
        $quickDip = $post->tags()->whereSlug('quick-dip')->first() ;
@themsaid
themsaid / AppServiceProvider.php
Created Jan 26, 2020
Re-encryption after APP_KEY rotation
View AppServiceProvider.php
<?php
namespace App\Providers;
use App\Encrypter;
use Illuminate\Support\Str;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
View pushme
function pushme {
br=`git branch | grep "*"`
git add --all
if (($# > 1)); then
params=''
for i in $*;
do
@themsaid
themsaid / openpr.sh
Created Aug 21, 2017
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 / pagination.blade.php
Created Apr 21, 2017
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)
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
View test.php
<?php
function(){
echo "Hello";
}
View scripts.bash
alias art="php artisan"
alias dracarys="git reset --hard && git clean -df"
alias phpfix="php php-cs-fixer.phar fix"
alias weather='curl -s wttr.in/Hurghada | sed -n "2,7p"'
alias usd='curl -s "https://www.google.com/finance/converter?a=1&from=USD&to=EGP" | LC_CTYPE=C sed "/res/!d;s/<[^>]*>//g"'
alias shrug="echo '¯\_(ツ)_/¯' | pbcopy";
alias fight="echo '(ง'̀-'́)ง' | pbcopy";
alias happy="echo 'ᕕ( ᐛ )ᕗ' | pbcopy";
# Commit all the current changes with a message
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
@themsaid
themsaid / HasEnums.php
Last active Nov 21, 2016
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)
{
You can’t perform that action at this time.