Skip to content

Instantly share code, notes, and snippets.

@jachanga
jachanga / MultipartFormDataInputToMultipartFormDataOutput.java
Created January 9, 2017 15:28
RestEasy MultipartFormDataInput to MultipartFormDataOutput
private MultipartFormDataOutput fromFormDataInputToFormDataOutput(MultipartFormDataInput input) {
MultipartFormDataOutput mdo = new MultipartFormDataOutput();
int i = 0;
for (Entry < String, List < InputPart >> inputPartEntry: input.getFormDataMap().entrySet()) {
String partId = inputPartEntry.getKey();
partId = partId.replaceAll("[^a-z,A-Z]", ""); //remove number al final
List < InputPart > inputParts = inputPartEntry.getValue();
for (InputPart part: inputParts) {
MultivaluedMap < String, String > headers = part.getHeaders();
@jachanga
jachanga / PropertiesReadWrite.java
Last active March 30, 2017 16:57
Class for Read / Write Properties File in Java
package com.examples.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
public class PropertiesReadWrite {
@jachanga
jachanga / index.html
Created April 27, 2017 12:07
Simple Sample Angular Sum
<html ng-app>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Simple Sum Angular (Simple Sample)</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.1/angular.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
@jachanga
jachanga / index.html
Last active June 7, 2017 09:10
Jquery On several inputs
<!--https://jsfiddle.net/ct8kymrp/-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<title>Ejemplo Jquery On</title>
@jachanga
jachanga / index.html
Last active November 29, 2017 09:11
Easy way to show Map using Google
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Map Demo</title>
</head>
<body>
@jachanga
jachanga / index.html
Last active March 9, 2018 09:17
Test Online Bootstrap Code With VUE
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Bootstrap Example made in Vue.js</title>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="http://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://v4-alpha.getbootstrap.com/dist/js/bootstrap.min.js"></script>
<script src="https://v4-alpha.getbootstrap.com/assets/js/vendor/tether.min.js"></script>
<link rel="stylesheet" href="https://v4-alpha.getbootstrap.com/dist/css/bootstrap.min.css">
@jachanga
jachanga / index.html
Last active April 16, 2018 09:10
Simple AngularJS Start. Simple Controller
<!--https://bl.ocks.org/jachanga-->
<!doctype html>
<html ng-app="myApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Simple Sum Angular (Simple Sample. Simple Controller)</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.1/angular.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
@jachanga
jachanga / index.html
Created April 16, 2018 09:24
Simple start. AngularJS Version 1.6.9
<!doctype html>
<html xmlns:ng="http://angularjs.org" ng-app="ngApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Simple start. AngularJS Version 1.6.9</title>
<script src="https://code.angularjs.org/1.6.9/angular.js"></script>
</head>
<body>
<div>
I can add 1+2 = {{ 1+2 }}.
@jachanga
jachanga / index.html
Created April 16, 2018 09:34
Calling http. Simple ng-repeat. AngularJS Version 1.6.9.
<!doctype html>
<html xmlns:ng="http://angularjs.org" ng-app="ngApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Calling http. Simple ng-repeat. AngularJS Version 1.6.9. </title>
<script src="https://code.angularjs.org/1.6.9/angular.js"></script>
</head>
<body>
<div ng-controller="newCtrl">
<ul>
@jachanga
jachanga / index.html
Created April 16, 2018 10:25
Component Easy. AngularJS Version 1.6.9.
<!doctype html>
<html xmlns:ng="http://angularjs.org" ng-app="ngApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Component Easy. AngularJS Version 1.6.9. </title>
<script src="https://code.angularjs.org/1.6.9/angular.js"></script>
</head>
<body>
<div ng-controller="newCtrl">
<h1>{{top}}</h1>