This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Installation */ | |
| composer global require "laravel/installer" | |
| /* New Project Using Laravel */ | |
| laravel new blog | |
| /* New Project Using Composer */ | |
| composer create-project laravel/laravel nombre --prefer-dist | |
| /* Rename Project */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table st-table="displayedCollection" st-safe-src="rowCollection" class="table table-bordered table-striped no-border-top"> | |
| <thead> | |
| <tr class="search-header"> | |
| <th colspan="6"> | |
| <span>Buscar:</span> <input st-search="" class="form-control input-sm" type="text"/> | |
| </th> | |
| </tr> | |
| <tr> | |
| <th st-sort="codigo" class="sortable">Código</th> | |
| <th st-sort="nombre" class="sortable">Nombre</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.directive('textEditor', function () { | |
| return { | |
| require: 'ngModel', | |
| link: function(scope, element, attributes, controller) { | |
| scope.$watch(attributes.ngModel, function(value) { | |
| $(element).html(value); | |
| }); | |
| element.bind('keyup mouseup', function(){ | |
| controller.$setViewValue(element.html()); | |
| if (!scope.$$phase) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.directive('uiSelectRequired', function() { | |
| return { | |
| require: 'ngModel', | |
| link: function(scope, elm, attrs, ctrl) { | |
| ctrl.$validators.uiSelectRequired = function(modelValue, viewValue) { | |
| for(var prop in modelValue) { | |
| if(modelValue.hasOwnProperty(prop)) | |
| return true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2016 Develer S.r.L. | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('app') | |
| .directive('uiScrollGo', function() { | |
| return { | |
| restrict: 'AC', | |
| link: function(scope, el, attr) { | |
| el.on('click', function(e) { | |
| var target = $('#' + attr.uiScrollGo); | |
| if (target.length) { | |
| $('html, body').animate({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <span scroll-position="scroll"></span> | |
| <div ng-class="{show: scroll > 400, hide: scroll <= 400}"> | |
| <h2>I'm here</h2> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tableToExcel = (function() { | |
| var uri = 'data:application/vnd.ms-excel;base64,' | |
| , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><?xml version="1.0" encoding="UTF-8" standalone="yes"?><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>' | |
| , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) } | |
| , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }; | |
| return function(table, name) { | |
| if (!table.nodeType) table = document.getElementById(table); | |
| var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML }; | |
| window.location.href = uri + base64(format(template, ctx)); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Generar api desde tabla | |
| php artisan infyom:api $MODEL_NAME --fromTable --tableName=$TABLE_NAME | |
| Test api | |
| vendor\bin\phpunit | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getParameterByName(name, url) { | |
| if (!url) url = window.location.href; | |
| name = name.replace(/[\[\]]/g, "\\$&"); | |
| var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), | |
| results = regex.exec(url); | |
| if (!results) return null; | |
| if (!results[2]) return ''; | |
| return decodeURIComponent(results[2].replace(/\+/g, " ")); | |
| } |