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
@pinei
pinei / README.md
Created May 4, 2022 14:22
Git SSH over Proxy (Windows)

Create ~/.ssh/config (notepad %home%\.ssh\config)

ProxyCommand "C:\Program Files\Git\bin\connect.exe" -H <proxy-server>:<proxy-http-port> %h %p

Host 127.0.0.1
  HostName 127.0.0.1
  User <username>

Host github.com
@pinei
pinei / zipup.vbs
Created October 12, 2021 04:40
Zip a folder with Windows command-line or .bat
Set fso = CreateObject("Scripting.FileSystemObject")
InputFolder = fso.GetAbsolutePathName(WScript.Arguments.Item(0))
ZipFile = fso.GetAbsolutePathName(WScript.Arguments.Item(1))
' Create empty ZIP file.
CreateObject("Scripting.FileSystemObject").CreateTextFile(ZipFile, True).Write "PK" & Chr(5) & Chr(6) & String(18, vbNullChar)
Set objShell = CreateObject("Shell.Application")
Set source = objShell.NameSpace(InputFolder).Items
objShell.NameSpace(ZipFile).CopyHere(source)
@pinei
pinei / Order By Year Desc
Created September 26, 2021 19:59
Software Architecture Books
The Software Architect Elevator (2020)
Architecting for Scale (2020)
Fundamentals of Software Architecture (2020)
The Unicorn Project (2019)
Semantic Software Design (2019)
The Pragmatic Programmer (2019)
Technology Strategy Patterns (2018)
Refactoring (2018)
Release It (2018)
The Model Thinker (2018)
@pinei
pinei / dados-abertos.md
Last active November 13, 2020 22:21
Dados abertos
@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 / 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 / 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 / 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 / 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 / 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