Skip to content

Instantly share code, notes, and snippets.

View lecano's full-sized avatar
🧩
Focusing

Luis Cano lecano

🧩
Focusing
  • Perú
View GitHub Profile
@asiraky
asiraky / gist:4ea5136e54c8df2de3fb6689f0a5ce18
Created March 24, 2021 07:21
Ubuntu 20.04 SQL Server ODBC Drivers for PHP 7.2
#run through the steps detailed here to install the odbc drivers for Ubuntu 20
https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#ubuntu17
#then force pecl to use 7.2
sudo pecl -d php_suffix=7.2 install sqlsrv-5.3.0
sudo pecl -d php_suffix=7.2 install pdo_sqlsrv-5.3.0
sudo bash -c 'echo "extension=sqlsrv.so" > /etc/php/7.2/mods-available/sqlsrv.ini'
sudo bash -c 'echo "extension=pdo_sqlsrv.so" > /etc/php/7.2/mods-available/pdo_sqlsrv.ini'
@MarZab
MarZab / Multiselect.vue
Last active January 15, 2021 19:50
vue-multiselect inside bootstrap-vue; demo: https://codesandbox.io/s/0x608nxo10
<template>
<div
:tabindex="searchable ? -1 : tabindex"
:class="[isOpen?'active':'', disabled?'disabled':'', size && size !== 'default'? 'multiselect-'+size : '' ]"
@focus="activate()"
@keydown.self.down.prevent="pointerForward()"
@keydown.self.up.prevent="pointerBackward()"
@keydown.enter.tab.stop.self="addPointerElement($event)"
@keyup.esc="deactivate()"
class="multiselect">
@meSingh
meSingh / JsonMiddleware.php
Last active July 11, 2022 09:19
If you are using laravel as api only, you might want to return JSON on every request, even on errors/exceptions. The easiest way to do so is using this middleware globally.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class JsonMiddleware
{
public function handle(Request $request, Closure $next)
@stevebauman
stevebauman / Throttle.php
Last active February 25, 2025 07:16
Laravel Throttle Validation Rule
<?php
namespace App\Rules;
use Illuminate\Http\Request;
use Illuminate\Cache\RateLimiter;
use Illuminate\Contracts\Validation\Rule;
class Throttle implements Rule
{
@santisbon
santisbon / Update-branch.md
Last active September 28, 2025 09:25
Deploying from Git branches adds flexibility. Bring your feature branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master.