Skip to content

Instantly share code, notes, and snippets.

View gabrielrtakeda's full-sized avatar
👁️
—————————:::—————————

Gabriel Ramos Takeda gabrielrtakeda

👁️
—————————:::—————————
  • Brazil
View GitHub Profile
@gabrielrtakeda
gabrielrtakeda / slate-editor-purge-empty-links.js
Last active June 8, 2017 18:49
[Nossas] Slate Editor: purge empty link objects
@gabrielrtakeda
gabrielrtakeda / slate-editor-state-object-migration.js
Last active June 2, 2017 15:33
[Nossas] Slate Editor: state object migration from < v2.3 to v2.6
//
// requirements:
// - node.js version: >= v7.10.0
//
// installation:
// - `mkdir slate-editor-state-object-migration` (make a new directory)
// - `yarn init` (initialize yarn)
// - `yarn add lodash json-stringify-pretty-compact escape-json-node --save` (install dependencies)
// - download the script using the command below:
// - curl -s https://gist.githubusercontent.com/gabrielrtakeda/ad4646ac01be7a6d2acb769d8fa69113/raw/ba832904dce897e092a7a9ed962d1cb9ad611613/slate-editor-state-object-migration.js > ./migration.js
@gabrielrtakeda
gabrielrtakeda / github-labels-restore-default.sh
Last active April 11, 2017 23:36
Github Labels Restore Default
#
# Simply run the following command, replacing with your data:
#
# ```
# sh <(curl -s https://gist.githubusercontent.com/gabrielrtakeda/83c78d82fdffbc850c42bf4e9a763c4f/raw/240ce181ed3041a5ce4061153e4ef06450686504/github-labels-restore-default.sh)\
# :github_username :github_password :github_owner :github_repo
# ```
#
# - :github_username = your github username
# - :github_password = your github password (escape special chars e.g. !@# -> \!\@\#)
@gabrielrtakeda
gabrielrtakeda / github-labels-replacement.sh
Last active April 11, 2017 23:34
Github Labels Replacement with [priority], [status] and [type]
#
# Simply run the following command, replacing with your data:
#
# ```
# sh <(curl -s https://gist.githubusercontent.com/gabrielrtakeda/b1c0442ca428ddc0ddb38903d06a6226/raw/08adcd07e30f04e1c266dc32ac8a32106cbcd225/github-labels-replacement.sh)\
# :github_username :github_password :github_owner :github_repo
# ```
#
# - :github_username = your github username
# - :github_password = your github password (escape special chars e.g. !@# -> \!\@\#)

UC01 – LOGIN

step class method params
View LoginForm requestLoginAuthentication email, password
Controller DeviseTokenAuth::Sessions create email, password
Model User find self
Database ActiveRecord::Base query self

UC02- MANTER USUARIO

--
-- Header Font
--
-- Armata
update mobilizations set header_font='Armata'
from (select id from mobilizations where header_font = 'armata') as subquery
where mobilizations.id=subquery.id;
-- Arvo
update mobilizations set header_font='Arvo'
from (select id from mobilizations where header_font = 'arvo') as subquery
@gabrielrtakeda
gabrielrtakeda / zebra-csp.pl
Last active September 6, 2016 01:07
Implementação da solução do Puzzle de Zebra em GNU-Prolog com CSP.
%
% Considere o seguinte quebra-cabeça lógico: em cinco casas, cada uma com uma cor diferente,
% moral 5 pessoas de diferentes nacionalidades, cada uma das quais prefere uma marca de cigarros
% diferente, uma bebida diferente e um animal de estimação diferente. Dados os fatos a seguir, a
% pergunta é: "Onde vive a zebra e em que casa se bebe água?"
%
% Dicas:
% - 01) O inglês mora na casa vermelha.
% - 02) O espanhol é o dono do cachorro.
% - 03) O norueguês mora na primeira casa à esquerda.
@gabrielrtakeda
gabrielrtakeda / zebra.pl
Created August 31, 2016 06:45
Implementação da solução do Puzzle Zebra em GNU-Prolog.
%
% Considere o seguinte quebra-cabeça lógico: em cinco casas, cada uma com uma cor diferente,
% moral 5 pessoas de diferentes nacionalidades, cada uma das quais prefere uma marca de cigarros
% diferente, uma bebida diferente e um animal de estimação diferente. Dados os fatos a seguir, a
% pergunta é: "Onde vive a zebra e em que casa se bebe água?"
%
% Dicas:
% - 01) O inglês mora na casa vermelha.
% - 02) O espanhol é o dono do cachorro.
% - 03) O norueguês mora na primeira casa à esquerda.
@gabrielrtakeda
gabrielrtakeda / einstein-site.pl
Last active August 31, 2016 06:46
Implementação do Teste de Q.I. do Einstein em GNU-Prolog.
%
% https://rachacuca.com.br/teste-de-einstein/
%
% Regras básicas para resolver o teste:
% - Há 5 casas de diferentes cores;
% - Em cada casa mora uma pessoa de uma diferente nacionalidade;
% - Esses 5 proprietários bebem diferentes bebidas, fumam diferentes tipos de cigarros e têm um certo animal de estimação;
% - Nenhum deles têm o mesmo animal, fumam o mesmo cigarro ou bebem a mesma bebida.
%
% Dicas: