Skip to content

Instantly share code, notes, and snippets.

View coderdiaz's full-sized avatar
:electron:

Javier Diaz coderdiaz

:electron:
View GitHub Profile
@coderdiaz
coderdiaz / routes.php
Created February 21, 2016 06:23 — forked from lukemartin/routes.php
Output checkboxes with appropriate 'checked' attributes in Laravel
Route::get('edit', function() {
// fetch our post, and it's associated categories
$post = Post::with('cats')->where('id', '=', $id)->first();
// fetch all of our categories
$cats = Cat::all();
// create our empty array
$post_cats = array();
@coderdiaz
coderdiaz / app.js
Created February 2, 2016 22:24 — forked from jdnichollsc/app.js
SQLite plugin with ngCordova in Ionic Framework => Using service pattern (Works for litehelpers/Cordova-sqlite-storage and MSOpenTech/cordova-plugin-websql) Code => http://1drv.ms/1Ono0Ys
angular.module('Demo', ['ionic', 'Demo.controllers', 'Demo.services', 'ngCordova'])
.run(function ($ionicPlatform, sqliteService) {
$ionicPlatform.ready(function () {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
@coderdiaz
coderdiaz / gist:cbda6c69ac1e8b39c4bf
Created November 4, 2015 19:33 — forked from farandal/gist:6144701
Translated default messages for the jQuery validation plugin. Spanish
/*
* Translated default messages for the jQuery validation plugin.
* Locale: ES
*/
jQuery.extend(jQuery.validator.messages, {
required: "Este campo es obligatorio.",
remote: "Por favor, rellena este campo.",
email: "Por favor, escribe una dirección de correo válida",
$.each(response.errors, function(i, row) {
var fila = $('<tr/>');
$.each(row, function(name, value) {
$('<td/>', {
text: value
}).appendTo(fila);
});
fila.appendTo('#errors_in_modal');
});
@coderdiaz
coderdiaz / object.php
Created October 29, 2015 20:01
Obtener el tamaño de un objeto
<?php
$objeto = new StdClass;
$objeto->key1 = 0;
$objeto->key2 = 0;
$objeto->key3 = 0;
$objeto->key4 = 0;
echo count((array) $objeto);
@coderdiaz
coderdiaz / jquery.spin.js
Created September 25, 2015 22:09 — forked from innotekservices/jquery.spin.js
jQuery Plugin for Spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@coderdiaz
coderdiaz / Gruntfile.js
Created August 5, 2015 18:16
Gruntfile.js
module.exports = function (grunt) {
require('jit-grunt')(grunt);
grunt.initConfig({
less: {
development: {
options: {
compress: true,
yuicompress: true,
@coderdiaz
coderdiaz / laravel
Created July 17, 2015 19:35
Laravel 5 Apuntador
===================================================================================
Laravel 5
===================================================================================
Configuración del Proyecto
-> Asignarle un nombre al proyecto: Para llevar a cabo esto debemos colocarnos en nuestro directorio principal del proyecto y
utilizar el comando siguiente: php artisan app:name Nombre_de_la_App, con este comando, Artisan se encargara de asignarle
el nombre a nuestra aplicación.
@coderdiaz
coderdiaz / homestead
Created July 16, 2015 05:32
Instalación de Homestead para Trabajar en el Entorno Laravel
Instalacion de Homestead
==========================================
1. Descargar Vagrant y Virtual Box; Realizar la instalación.
2. Posteriormente descargar mediante el comando $git clone la instanciación
$ git clone [email protected]:laravel/homestead.git Nombre_de_Instancia
3. Acceder al directorio y lanzar el script init.sh.