Skip to content

Instantly share code, notes, and snippets.

View marti1125's full-sized avatar
๐Ÿ

Willy Aguirre marti1125

๐Ÿ
View GitHub Profile
const Culqi = require('culqi-node');
const culqi = new Culqi('test_462ikymMGqUf', 'C/9qeO95+Ii6qjupoJkeaDKlepFSx5Q6LbXpovObijc=', 'integ');
var token = ''
culqi.crearToken({
"correo_electronico": "[email protected]",
"nombre": "William",
"apellido": "Muro",
@marti1125
marti1125 / open source
Created January 2, 2017 01:49
Community Support - Open Source Project Repository Hosting
https://issues.sonatype.org/browse/OSSRH-27316
https://issues.sonatype.org/browse/OSSRH-3109
https://issues.sonatype.org/browse/OSSRH-22221
http://stackoverflow.com/questions/5587513/how-to-export-private-secret-asc-key-to-decrypt-gpg-files-in-windows
http://central.sonatype.org/pages/apache-maven.html
@marti1125
marti1125 / php culqi
Last active January 9, 2017 23:31
php tips
zip woocommerce
zip -r culqi-woocommerce-dev.zip culqi-woocommerce
http://askubuntu.com/questions/761713/how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04
https://www.cyberciti.biz/faq/star-stop-restart-apache2-webserver/
sudo /etc/init.d/apache2 restart
package test;
import com.culqi.model.Config;
import com.culqi.model.Plan;
import org.apache.http.*;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
https://modernweb.com/45-useful-javascript-tips-tricks-and-best-practices/
@RequestMapping(value = "/clientes/guardar", method = { RequestMethod.POST })
public String guardarcliente(Model model, @Valid Cliente cliente, BindingResult bindingResult) throws ParseException {
model.addAttribute("fechaNacimiendo",new Util().DatetoString(cliente.getFecNacCliente()));
if(clienteRepository.findByNroDocumento(cliente.getNroDocumento()) != null){
ObjectError error = new ObjectError("nroDocumento","Cliente ya se encuentra registrado.");
bindingResult.addError(error);
}
if (bindingResult.hasErrors()) {
model.addAttribute("tipoDocumentos", tipoDocumentosRep.findAll());
model.addAttribute("tipoClientes", tipoClienteRep.findAll());
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8" />
<title>Pet Center</title>
<link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap.min.css}" />
<link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap-theme.min.css}" />
<link rel="stylesheet" type="text/css" th:href="@{/css/app.css}" />
</head>
<body>
@RequestMapping("/clientes/{page}")
public String clientes(@PathVariable("page") int page, Model model) {
model.addAttribute("tipoDocumentos", tipoDocumentosRep.findAll());
List<ClienteDto> clientesDto = new ArrayList<>();
Page<Cliente> clientes = clienteRepository.findAll(new PageRequest(page-1, 6));
for (Cliente c : clientes) {
ClienteDto cDto = new ClienteDto();
cDto.setIdCliente(c.getIdCliente());
cDto.setCodCliente(c.getCodCliente());
cDto.setTipoCliente(c.getTipoCliente().getDescripcionTipoCliente());
tar -xvfz file.tar.gz
$ pgrep firefox
$ pkill firefox
const http = require('http');
var options = {
host: 'www.thestartv.com',
port: 80,
path: '/'
};
http.get(options, function(res) {
console.log("Got response: " + res.statusCode);