Skip to content

Instantly share code, notes, and snippets.

View emanoelqueiroz's full-sized avatar
💻
Programming...

Emanoel Queiroz emanoelqueiroz

💻
Programming...
View GitHub Profile
function ajax(obj) {
'use strict';
if (!obj || typeof obj !== 'object') throw new Error('Object parameter is null or undefined.');
obj = {
url: obj.url || null,
type: obj.type || 'json',
method: obj.method || 'GET',
success: obj.success || null
@emanoelqueiroz
emanoelqueiroz / gerartag.md
Last active December 7, 2017 19:08
Comandos para gerar nova versão das tags

Comandos para gerar nova versão das tags

Para gerar uma nova versão da tag seguir os seguintes passos:

  1. Comitar tudo para dev e depois para a master.
  2. Executar o comando de merge da dev para a master git merge dev.
  3. Executar o comando npm version parametro-versão na branch master.
  4. Executar o comando git push --follow-tags na branch master para gerar a nova versão.

Opção de parâmetros para o comando npm version:

  • patch irá mudar a ultima casa da versão.
@emanoelqueiroz
emanoelqueiroz / electron_context_menu.js
Created September 25, 2017 13:06 — forked from luizcarraro/electron_context_menu.js
[ELECTRON] Menu-contexto com opções de copiar, colar e cortar em inputs e divs
(function () {
'use strict';
const remote = require('electron').remote;
const Menu = remote.Menu;
const MenuItem = remote.MenuItem;
const isAnyTextSelected = function () {
return window.getSelection().toString() !== '';
};
@emanoelqueiroz
emanoelqueiroz / number-utils.js
Last active August 10, 2017 11:30
Utilitários para tratar de números.
/**
* Utilitários para tratar de números.
*/
export default {
/**
* Método para deixar apenas números na string.
*
* @param {String} str String que será manipulada.
* @return {String} Retorna apenas os números da string.
@emanoelqueiroz
emanoelqueiroz / remover-acentos.js
Last active August 8, 2017 17:40 — forked from marioplumbarius/remover-acentos.js
Funcao marota para remover acentos de strings. Foi utilizado expressao regular em cima de caracteres representados na base hexadecimal.
/**
* Remove acentos de caracteres
* @param {String} stringComAcento [string que contem os acentos]
* @return {String} [string sem acentos]
*/
function removerAcentos(str) {
var mapaAcentosHex = {
a : /[\xE0-\xE6]/g,
e : /[\xE8-\xEB]/g,
i : /[\xEC-\xEF]/g,
@emanoelqueiroz
emanoelqueiroz / DataTableOrder.js
Last active October 2, 2017 17:23
Storage sort from DataTable plugin with LocalStorage.
// Just puting the table element on a variable
// to not search for the element every time;
let $dataTable = $('#table');
// Get the actual order;
$dataTable.DataTable().order();
// Insert new order;
$dataTable.DataTable().order(/* params... */);
private void setParentId(T parentEntity, List<T> listEntity) {
try {
Long parentId = null;
for (Field field : parentEntity.getClass().getDeclaredFields()) {
if (field.getDeclaredAnnotation(SequenceId.class) == null) {
continue;
}
PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(parentEntity.getClass(), field.getName());
<div class="login-background">
<div class="login-content">
<div class="login-container login-portal">
<div class="login-logo">
<div class="talentrh-loading">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 293.23 60.96" width="293.23" height="60.96">
<title>talentrh</title>
<g id="Layer_2" data-name="Layer 2">
<g id="Design">
<path class="cls-1" d="M288.77,60.82a4.31,4.31,0,0,1-3.07-1.26,4,4,0,0,1-1.29-3V45H270.25V56.54a4.07,4.07,0,0,1-1.31,3,4.23,4.23,0,0,1-3.05,1.24h-.1a4.31,4.31,0,0,1-3.07-1.26c-.89-.84-1.29-2.2-1.29-4.39V24.56a4.34,4.34,0,0,1,4.36-4.74h.1A4.37,4.37,0,0,1,268.94,21a4.19,4.19,0,0,1,1.31,3.07V36.53H284.4V24.1A4.19,4.19,0,0,1,285.7,21a4.39,4.39,0,0,1,3.07-1.23h.1A4.37,4.37,0,0,1,291.92,21c.87.85,1.31,1.84,1.31,4.86V56.76a3.9,3.9,0,0,1-1.31,2.82,4.24,4.24,0,0,1-3.05,1.24Z"
@emanoelqueiroz
emanoelqueiroz / style.less
Created June 26, 2017 19:57
Loading gostoso
// -----------------
// Colors
// -----------------
@loader-white: #FFFFFF;
@loader-black: #333333;
@loader-red: #EA4335;
@loader-green: #34A853;
@loader-blue: #409AFE;
@loader-yellow: #FBBC05;
@loader-purple: #9C27B0;
// Logo do SVG
.simbolo-talentrh-loading {
position: relative;
width: 150px;
max-width: 90%;
}
.simbolo-talentrh-loading svg {
padding: 16px 11px;
}
.simbolo-talentrh-loading .cls-1 {