Skip to content

Instantly share code, notes, and snippets.

View mariapaulinar's full-sized avatar
🐶

María Paulina Ramírez Vásquez mariapaulinar

🐶
View GitHub Profile
@mariapaulinar
mariapaulinar / yajra-datatables-from-controller.php
Last active October 17, 2016 03:49
Crear datatables desde controlador
use Yajra\Datatables\Html\Builder; // import class on controller
/**
* Datatables Html Builder
* @var Builder
*/
protected $htmlBuilder;
public function __construct(Builder $htmlBuilder)
{
@mariapaulinar
mariapaulinar / conf-virtualhost-apache.conf
Last active September 27, 2017 14:01
Configurar un virtualhost en apache
<VirtualHost *:80>
ServerName myapp.localhost.com
DocumentRoot "/home/vagrant/projects/myapp/public"
<Directory "/home/vagrant/projects/myapp/public">
AllowOverride all
</Directory>
</VirtualHost>
@mariapaulinar
mariapaulinar / seeder-laravel.php
Last active August 20, 2016 20:47
Ejemplo de seeder en Laravel
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
@mariapaulinar
mariapaulinar / artisan-commands
Last active January 15, 2019 16:50
Comandos Artisan
Crear un controlador:
php artisan make:controller NombreControladorController
Crear un modelo:
php artisan make:model NombreModelo
Crear un request
@mariapaulinar
mariapaulinar / model-with-softdeletes.php
Created August 20, 2016 20:45
Model con soft delete
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Flight extends Model
{
use SoftDeletes;
@mariapaulinar
mariapaulinar / lang-datatables
Created August 20, 2016 22:28
Idiomas en DataTables
https://cdn.datatables.net/plug-ins/1.10.12/i18n/
@mariapaulinar
mariapaulinar / DataTable.php
Last active July 1, 2019 17:36
DataTables con SQL Server 2008 R2
<?php
class DataTable {
var $database = "test";
var $host = "127.0.0.1";
var $user = "usertest";
var $pass = "secret";
//Seleccionar un option específico en un select
$('option[value="SEL1"]').prop('selected', true); //Por value
$('option:eq(1)').prop('selected', true); //Por índice
$('option:contains("Selección 1")').prop('selected', true); //Por algún texto
@mariapaulinar
mariapaulinar / archivo.js
Created March 23, 2017 14:45
Subir archivos por ajax
$( '#my-form' )
.submit( function( e ) {
$.ajax( {
url: 'http://host.com/action/',
type: 'POST',
data: new FormData( this ),
processData: false,
contentType: false
} );
e.preventDefault();
@mariapaulinar
mariapaulinar / div.html
Created March 28, 2017 16:24
Centrar div con bootstrap
<div class="container">
<div class="row row-centered">
<div class="col-xs-6 col-centered"></div>
<div class="col-xs-6 col-centered"></div>
<div class="col-xs-3 col-centered"></div>
<div class="col-xs-3 col-centered"></div>
<div class="col-xs-3 col-centered"></div>
</div>
</div>