Skip to content

Instantly share code, notes, and snippets.

@oriolrivera
oriolrivera / spinner.java
Created June 14, 2018 02:32
Add hashmap key value to spinner
Map<String, String> spinnerValueMap = new HashMap<String, String>();
List<StringWithTag> itemList = new ArrayList<StringWithTag>();
String loadsearchkeyID;
spinnerValueMap.put(“Key”,”Value”);
for (Entry<String, String> entry : spinnerValueMap.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
var query = { name: "prueba(2)" };
List.find(query, (err, lists) => {
if (err) return res.status(500).send({ message: `Error al realizar la petición: ${err}`})
if (!lists) return res.status(404).send({message: 'No existen registros'})
res.status(200).send({message: '', lists})
})
Add this at the end of php.ini:
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
---------------------------------------------------------------------------------
Add this to vs code settings file:
@oriolrivera
oriolrivera / FileImg.html
Created September 24, 2017 20:03
modificar boton file html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<title>Modificar estilo de un input file</title>
<style media="screen">
body {
background: darkgrey;
@oriolrivera
oriolrivera / itbis.js
Created August 30, 2017 02:45
calcular itbis 18% agregar porcentaje a monto y quitarlo
var calcObject = {
amountNull : '0.00',
amountTax : '0.00',
amountTotal : '0.00',
run : function() {
var amount = $('#amount').val();
var tax = $('#tax').val();
var included = $('#tax_included').is(':checked');
if (amount !== '' && tax !== '') {
if (included) {
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@oriolrivera
oriolrivera / maps.html
Created December 13, 2015 23:53
google maps
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
@oriolrivera
oriolrivera / index.php
Created September 9, 2015 23:33
detectando numero multiplo de 3,5
<?php
for ($i=1; $i < 200; $i++) {
if (fmod($i,5)) {
echo $i."<br>";
}else{ if (!fmod($i,5)) {
echo "red<br>";
}
}
@oriolrivera
oriolrivera / index.php
Created June 22, 2015 06:16
Simple Chat Using WebSocket and PHP Socket
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8' />
<style type="text/css">
<!--
.chat_wrapper {
width: 500px;
margin-right: auto;
margin-left: auto;
@oriolrivera
oriolrivera / bootstrap.css
Created May 18, 2015 22:42
menu lateral con opcion categorias y subcategorias. html y css
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,