Skip to content

Instantly share code, notes, and snippets.

View sahibalejandro's full-sized avatar
😎
Doing cool stuff!

Sahib sahibalejandro

😎
Doing cool stuff!
View GitHub Profile
@sahibalejandro
sahibalejandro / disable-font-smoothing.sh
Created February 29, 2016 06:57
Disable font smoothing for an app
defaults write org.vim.MacVim AppleFontSmoothing -int 0
@sahibalejandro
sahibalejandro / vimrc
Last active March 24, 2017 17:42
vimrc file
"---------- Vundle {{{
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin() "Start Vundle plugins definition
Plugin 'VundleVim/Vundle.vim' "Vundle to manage Vimplugins
Plugin 'wincent/command-t' "Fast file navigation for VIM
@sahibalejandro
sahibalejandro / RfcValidator.php
Last active June 29, 2021 23:31
Laravel's RFC Validator
<?php
/**
* @author Sahib J. Leo <sahib@sahib.io>
* Date: 11/24/15 8:53 AM
*/
namespace App\Validation;
class RfcValidator
{
@sahibalejandro
sahibalejandro / deploy.sh
Last active January 8, 2024 17:48
Deploy script for Laravel projects.
# Shutdown the laravel app
php artisan down
# Install new composer packages
composer install --no-dev --prefer-dist
# Cache boost configuration and routes
php artisan cache:clear
php artisan config:cache
php artisan route:cache
@sahibalejandro
sahibalejandro / Uuid.php
Last active January 20, 2016 18:08
Uuid trait to use on eloquent models.
namespace App\Eloquent;
use Ramsey\Uuid\Uuid;
trait UuidField
{
/**
* Add a uuid to the model before persist to the data base.
*
* @param array $options
@sahibalejandro
sahibalejandro / csrf-token.js
Created November 1, 2015 09:03
Get csrf token form meta tag
export default () => {
return document.querySelector('meta[name="csrf-token"]').getAttribute('content');
};
@sahibalejandro
sahibalejandro / MakeViewCommand.php
Created April 13, 2015 04:45
Laravel Command make:view
<?php namespace Sahib\Generators\Commands;
use File;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
/**
* Class MakeViewCommand
* @package Sahib\Generators\Commands
*/
@sahibalejandro
sahibalejandro / LocaleAttributes.php
Created March 31, 2015 00:04
Laravel Model Locale Attributes
<?php
/**
* Author: Sahib J. Leo <sahib@sahib.io>
*
* Don't forget to add "model_fallback_locale" to your config/app.php
*
*/
namespace App\Support;
use App;
@sahibalejandro
sahibalejandro / sips
Created September 16, 2014 01:22
Scale images using sips
sips -Z <max_size> <file/files>
@sahibalejandro
sahibalejandro / scale-video.sh
Last active August 29, 2015 14:06
Scale GoPRO videos using ffmpeg
ffmpeg -i <input_video> -filter:v scale=-1:<new_height> -c:a copy <output_video>