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
| if (!function_exists('dd')) { | |
| function dd() | |
| { | |
| array_map(function($x) { | |
| dump($x); | |
| }, func_get_args()); | |
| die; | |
| } | |
| } |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
| <title>datatable</title> | |
| <link | |
| rel="stylesheet" | |
| href="http://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" |
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
| /*************************************************************/ | |
| // NumeroALetras | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2015 Luis Alfredo Chee | |
| // | |
| // 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 |
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 calcular() { | |
| return new Promise((resolve, reject) => { | |
| // setTimeout(resolve, 400, 5); | |
| setTimeout(()=>{ | |
| resolve(4); | |
| }, 400) | |
| }) | |
| } | |
| function segundoCalculo(numero) { | |
| console.log(numero); |
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
| let p1 = new Promise((resolve, reject) => setTimeout(resolve, 500, "hola mundo")); | |
| let p2 = new Promise((resolve, reject) => setTimeout(resolve, 600, "hola mundo a todos")); | |
| let p3 = Promise.reject(); | |
| let saluda = () => console.log("hola a todos sapencio"); | |
| // mismo problema de callback hell | |
| // p1.then(function () { |
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
| const request = require('request'); | |
| function leer(url) { | |
| return new Promise((resolve, reject) => { | |
| request(url, function (err, response) { | |
| if (err) { | |
| reject(err) | |
| } else { | |
| resolve(response); | |
| } |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> |
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
| public function migrateInit($schemaName, $args = []) | |
| { | |
| $this->switchTo($schemaName); | |
| if (!$this->tableExists($schemaName, 'migrations')) { | |
| Artisan::call('migrate:install'); | |
| } | |
| Artisan::call('migrate:refresh', $args); | |
| } |
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
| <h2>jQuery input filter showcase</h2> | |
| <p><b>Supports:</b> Copy+Paste, Drag+Drop, keyboard shortcuts, context menu operations, non-typeable keys, and all keyboard layouts.</p> | |
| <p><b>Compatibility:</b> Cross-browser and on mobile, IE 9+.</p> | |
| <p><b>Note:</b> There is also a <a href="https://jsfiddle.net/emkey08/zgvtjc51" target="_blank">pure JavaScript version</a> of this, jQuery isn't actually needed.</p> | |
| <table> | |
| <tr><td>Integer:</td><td><input id="intTextBox"></td></tr> | |
| <tr><td>Integer up to 1500:</td><td><input id="intLimitTextBox"></td></tr> | |
| <tr><td>Unsigned integer:</td><td><input id="uintTextBox"></td></tr> | |
| <tr><td>Hex integer:</td><td><input id="hexTextBox"></td></tr> | |
| <tr><td>Float:</td><td><input id="floatTextBox"></td></tr> |
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 formas_pago = JSON.parse('<?php echo json_encode($forma_pagos); ?>'); | |
| function removeSelectPago(noclick) { | |
| var seleindex; | |
| $('.select_formapago').on('change', (e)=>{ | |
| var option_value = parseInt(e.target.value); | |
| if (option_value !== 1 && noclick){ | |
| console.log(option_value) | |
| seleindex = formas_pago.map(function(e) { return e.id; }).indexOf(option_value); | |
| console.log(formas_pago); | |
| formas_pago.splice(seleindex, 1); |