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
### Keybase proof | |
I hereby claim: | |
* I am josefigueredo on github. | |
* I am josefigueredo (https://keybase.io/josefigueredo) on keybase. | |
* I have a public key ASCQ8yBb1Qr4i4uEPgw7rWtzrhWkzHntPXM6B87tBdhAQAo | |
To claim this, I am signing this object: |
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
.exchangeStrategies( | |
ExchangeStrategies.builder() | |
.codecs { | |
it.defaultCodecs() | |
.jackson2JsonEncoder( | |
Jackson2JsonEncoder(newMapper) | |
) | |
} | |
.codecs { | |
it.defaultCodecs() |
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 computeHttpSignature(config, headerHash) { | |
var template = 'keyId="${keyId}",algorithm="${algorithm}",headers="${headers}",signature="${signature}"', | |
sig = template; | |
// compute sig here | |
var signingBase = ''; | |
config.headers.forEach(function(h){ | |
if (signingBase !== '') { signingBase += '\n'; } | |
signingBase += h.toLowerCase() + ": " + headerHash[h]; | |
}); |
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
// Implementacion Minima de un Pago usando el SDK para Java de MercadoPago | |
//import com.mercadopago.MP; | |
//import org.codehaus.jettison.json.JSONArray; | |
//import org.codehaus.jettison.json.JSONObject; | |
MP mp = new MP("ACCESS_TOKEN"); | |
JSONObject payment = null; | |
try { |
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
{ | |
ResultActions result = mockMvc.perform(post(USERS) | |
.contentType(APPLICATION_JSON_UTF8) | |
.content(toJson(new UserRequest("user"))) | |
.accept(APPLICATION_JSON) | |
); | |
result.andExpect(status().isCreated()) | |
.andExpect(content().contentType(APPLICATION_JSON_UTF8)); |
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 http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Clock</title> | |
<link rel="stylesheet" type="text/css" href="style.css" media="screen" /> | |
</head> | |
<body> |
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
Whenever I want to create pull requests to a repo that I don't have write access to, I: | |
1. Fork the original repo to my account. | |
2. Clone the original repo to my local machine. | |
3. Add my fork as an additional remote and make it the push default. | |
4. Make changes in a new branch locally. | |
5. Push this branch to my fork. | |
6. Create a pull request from there. | |
``` |
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
fun <T : Any> Optional<T>.toNullable(): T? = this.orElse(null); | |
fun <T : Any> T?.toOptional(): Optional<T> = Optional.ofNullable(this) |
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
package com.josefigueredo.patterns; | |
public class StrategyPatternRunner { | |
public static void main(String[] args) { | |
String originalText = "This is a test from December 8th, 2020"; | |
String expectedText = "ThisisatestfromDecember8th,2020"; | |
noWhitespaces = Remover.remove(originalText, s -> s.replace(" ", "")); | |
assert noWhitespaces.equals(expectedText); |
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
package com.josefigueredo.patterns; | |
public interface RemoveStrategy { | |
String execute(String s); | |
} |
NewerOlder