Skip to content

Instantly share code, notes, and snippets.

View coderdiaz's full-sized avatar
:electron:

Javier Diaz coderdiaz

:electron:
View GitHub Profile
/* $cordovaCamera
* http://ngcordova.com/docs/plugins/camera/
*/
$scope.takepicture = function() {
var options = {
destinationType: Camera.DestinationType.FILE_URL,
quality: 90
};
$cordovaCamera.getPicture(options).then(function(imageData) {
@coderdiaz
coderdiaz / app.js
Created June 4, 2015 03:15
Datepicker without Weekends
$('#fecha2').datepicker({
changeMonth: true,
changeYear: true,
showOn: 'button',
buttonImage: 'css/images/ico.png',
buttonImageOnly: true,
showButtonPanel: true,
beforeShowDay: $.datepicker.noWeekends
});
@coderdiaz
coderdiaz / history.php
Created June 9, 2015 14:38
Union ALL with Laravel 4.2
<?php
/**
* Funcion para obtener el historial sobre una cuenta, a partir de los trámites que ha realizado.
* @return Response JSONArray
*/
public function obtenerHistorialCuentas($account)
{
$depositos = TesDepositos::select(DB::raw('1 AS tipo,tes_depositos.deposito_id as folio, tes_depositos.deposito_importe as importe, tes_depositos.deposito_date_revision as fecha, tes_depositos.deposito_estado as estado'))
->distinct()
//
// Colour customisation
//
// Border between the header (and footer) and the table body
@table-header-border: 1px solid #111111;
// Border of rows / cells
@table-body-border: 1px solid #dddddd;
@coderdiaz
coderdiaz / dates.js
Last active August 29, 2015 14:24
Order Dates on DataTables with format DD/MM/YY
$.fn.dataTable.ext.oSort['uk_date-desc'] = function( a,b ) {
var ukDatea = a.split('/');
var ukDateb = b.split('/');
var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1;
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
}
$.fn.dataTable.ext.oSort['uk_date-asc'] = function( a,b ) {
var ukDatea = a.split('/');
<div class="form-group">
<div class="col-md-4">
<span class="api-input-ico icon-calendar3"></span>
<input type="text" class="form-control api-input-wico" id="datepicker">
</div>
</div>
// Input with icons
.api-input-ico {
@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.
@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 / 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,