Skip to content

Instantly share code, notes, and snippets.

View pinei's full-sized avatar
🏠
Working from home

Pìnei pinei

🏠
Working from home
  • Petrobras
  • Rio de Janeiro, Brazil
View GitHub Profile
Aqua Data Studio 7.0.22
Depends on the following DLLs to connect to Oracle through OCI driver:
- ocijdbc10.dll
- oci.dll
@pinei
pinei / .gitignore
Last active September 1, 2015 21:23
Git ignore file for Grails / Java projects and IntelliJ IDEA
# Mac files
.DS_Store
*/.DS_Store
# Output
/target
/classes
/bin
/out
@pinei
pinei / WebServiceClient.java
Created September 4, 2015 19:54
Username token profile with CXF for SOAP Clients
import org.apache.cxf.endpoint.*;
import org.apache.cxf.ws.security.policy.model.Header;
import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.handler.WSHandlerConstants;
// ...
private static void addUsernameTokenProfileCXF(PapiWebService papiWebServicePort, String username) {
Client client = org.apache.cxf.frontend.ClientProxy.getClient(papiWebServicePort);
@pinei
pinei / REST convention
Created September 9, 2015 21:51
Tip from AngularJS Full-Stack generator
Rails-like standard naming convention for endpoints.
* GET /things -> index
* POST /things -> create
* GET /things/:id -> show
* PUT /things/:id -> update
* DELETE /things/:id -> destroy
@pinei
pinei / JacksonTest.java
Created February 27, 2019 23:31
Translating String[] to JSON and JSON to String[] with Jackson
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
public class JacksonTest {
@Test
@pinei
pinei / JacksonTest.java
Last active March 12, 2019 22:51
Working with ObjectMapper from Jackson (JSON processor for Java) to format/parse String arrays
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
@Transactional
@pinei
pinei / async_await.js
Created May 14, 2019 21:14
Javascript async/await
const LIST = ['Orange', 'Lemon', 'Banana' ]
process(LIST);
async function eachAsync(arr, fn) { // take an array and a function
for(const item of arr) await fn(item);
}
async function process(list) {
await eachAsync(list, async (data) => {
@pinei
pinei / office.css
Last active July 11, 2019 20:18
Typora theme customized for markdown documents
:root {
--side-bar-bg-color: #fff;
--control-text-color: #777;
}
/* cyrillic-ext */
@font-face {
font-family: 'Calibri';
font-style: normal;
font-weight: 400;
@pinei
pinei / styles.less
Last active September 12, 2020 15:38
Atom editor > stylesheet customizations > .atom/styles.less
/*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
* ...
*/
/*
* Markdown Heading Customization
* https://colordesigner.io/gradient-generator
*/
@pinei
pinei / dados-abertos.md
Last active November 13, 2020 22:21
Dados abertos