This file contains 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
public class AlignTableCellRenderer extends DefaultTableCellRenderer.UIResource | |
{ | |
private DefaultTableCellRenderer renderizador; | |
private int horizontalAlignment=SwingConstants.CENTER; | |
private Color foregroundColor=null; | |
private Color backgroundColor=null; | |
private Border frontera=null; | |
private int fontstyle=Font.PLAIN; | |
public AlignTableCellRenderer(JTable table) |
This file contains 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
_ |
This file contains 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
1. Instalar React-Native | |
2. Instalar dependencias iniciales | |
npm i react-native-material-ui --save | |
npm install react-native-vector-icons --save | |
react-native link react-native-vector-icons | |
yarn add react-native-navigation@latest | |
npm install --save react-redux | |
npm install --save redux | |
npm install --save redux-thunk | |
npm install --save redux-persist |
This file contains 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
// funciones-generador | |
// yeld es una palabra clave dentro de las funciones generador similar a return | |
// a dferencia de return, yeld suspende la ejecución para que pueda ser retomada luego | |
function* quips(name) { | |
yield "hello " + name + "!"; | |
yield "i hope you are enjoying the blog posts"; | |
if (name.startsWith("X")) { | |
yield "it's cool how your name starts with X, " + name; | |
} |
This file contains 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
// formas de hacer bucles en javascript | |
let arr = [1,2,3,4,5]; | |
// foreach ES6 | |
// se puede pasar el this usando la sintaxis antigua | |
arr.forEach((current, index, array) => { | |
console.log(current); | |
}); | |
// for-in |
This file contains 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
// Iterador que empieza sobre el índice indicado como parámetro | |
// ¿Por qué yield? | |
Array.prototype.myIterator = function* (startIdx = 0) { | |
while (startIdx < this.length) { | |
if (this.hasOwnProperty(startIdx)) { | |
yield [this[startIdx], startIdx]; | |
} | |
startIdx++; | |
} |
This file contains 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, " ")); | |
} |
This file contains 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 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 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> |
NewerOlder