Skip to content

Instantly share code, notes, and snippets.

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

Douglas Rafael douglasrafael

🏠
Working from home
View GitHub Profile
@douglasrafael
douglasrafael / .profile
Created June 30, 2020 02:03 — forked from davidrapin/.profile
Kill WebStorm when frozen (linux)
alias killws="ps -Alf |grep -i webstorm |grep -v grep |awk -F' ' '{print \$4}' |xargs kill -9 "
@douglasrafael
douglasrafael / README.md
Created February 27, 2020 05:12 — forked from lopspower/README.md
All InputType for EditText

All InputType for EditText

Twitter

Constant Description
none There is no content type. The text is not editable.
@douglasrafael
douglasrafael / travis-local.md
Created September 13, 2019 20:20 — forked from fulldecent/travis-local.md
Run Travis build locally

travis-local.md

Preconditions:

  1. POSIX or Windows system
  2. Install Docker
  3. A GitHub repo that already builds on Travis

Postcondition:

Snackbar snackbar = Snackbar.make(getView(), R.string.elderly_register_success, Snackbar.LENGTH_LONG);
View snackbarView = snackbar.getView();
TextView textView = (TextView) snackbarView.findViewById(android.support.design.R.id.snackbar_text);
textView.setMaxLines(4); // show multiple line
snackbar.setAction(R.string.yes_text, (v) -> {
mListener.onFormAssessment(elderly);
});
snackbar.show();
View focusView = null;
focusView = mPasswordView;
focusView.requestFocus();
@douglasrafael
douglasrafael / yunmai_protocol.txt
Created December 28, 2017 03:25 — forked from pwnall/yunmai_protocol.txt
Yunmai smart scale (M1301, M1302, M1303) Bluetooth LE protocol notes
Yunmai smart scale (M1301, M1302, M1303) Bluetooth LE protocol notes
Commands are written to GATT attribute 0xffe9 of service 0xffe5. Responses come
as value change notifications for GATT attribute 0xffe4 of service 0xffe0. These
are 16-bit Bluetooth LE UUIDs, so nnnn is 0000nnnn-0000-1000-8000-00805F9B34FB.
-----
Packet Structure
@douglasrafael
douglasrafael / gitflow-breakdown.md
Created December 25, 2017 22:14 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@douglasrafael
douglasrafael / git.md
Created October 14, 2017 03:32 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

#GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@douglasrafael
douglasrafael / contas.ejs
Created July 24, 2017 15:31
Aula 2 - Exercício 4
<% include header %>
<h2>Lista de contas mensal</h2>
<% if(contas.length > 0) { %>
<table border="1">
<thead>
<tr>
<th>Descrição</th>
<th>Valor Estimado</th>
<th>Dia Vencimento</th>
@douglasrafael
douglasrafael / index.js
Created July 24, 2017 14:29
Aula 2 - Exercício 3
app.get('/operacoes', async (req, res) => {
let operacoes = await findAll(app.db, 'operacoes')
// Tratando os filtros
if (req.query.filter && req.query.filter === 'entradas') {
operacoes = operacoes.filter(item => item.valor > 0)
} else if (req.query.filter && req.query.filter === 'saidas') {
operacoes = operacoes.filter(item => item.valor < 0)
}