Skip to content

Instantly share code, notes, and snippets.

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

Emanoel Queiroz emanoelqueiroz

💻
Programming...
View GitHub Profile
@emanoelqueiroz
emanoelqueiroz / Macaroni.js
Last active September 23, 2016 12:04
Look that bitch!
var obj = {};
obj = {
a: function(a) {
console.log('Você escolheu A de ' + a);
},
b: function(b) {
console.log('Você escolheu B de ' + b);
},
c: function(c) {
@emanoelqueiroz
emanoelqueiroz / makeObj.js
Last active January 16, 2017 13:34
Return an object with attributes referred by the fields name.
function makeObj($form) {
let obj = {};
$form.find("input, select, textarea").each(
(key, ele) => {
if (ele.name)
obj[ele.name] = null;
});
return obj;
@emanoelqueiroz
emanoelqueiroz / first-letter.js
Last active January 30, 2017 10:48
não acabado
function findFirstLetter () {
let body = document.getElementsByTagName("body")[0];
function childRun(ele) {
Object.keys(ele).forEach(
k => {
let childEle = ele[k];
if (childEle.children.length > 1)
console.log(childEle.children);
@emanoelqueiroz
emanoelqueiroz / generateSummary.js
Last active February 10, 2017 13:41
Generate a summary
function mergeArr(arr1, arr2) {
for (var i = 0; i < arr1.length; i++) {
for (var j = 0; j < arr2.length; j++) {
if (i !== j)
continue;
arr2[j] = arr1[i];
}
@emanoelqueiroz
emanoelqueiroz / htmlToString.java
Last active February 27, 2017 17:45
Carrega arquivo HTML pelo caminho passado por parâmetro e retorna uma String do conteúdo do mesmo.
/**
* Carrega arquivo HTML pelo caminho passado por parâmetro e retorna uma String do conteúdo do mesmo.
* Esses arquivos devem estar na pasta <b>resources</b> para que o método possa encontra-los.
* <p>
* <code>Ex.: FileUtil.getHtmlContent(Teste.class, "/htmlreport/template.html")</code>
*
* @param actualClass Clase atual
* @param filePath Caminho do arquivo HTML
* @return Conteúdo do arquivo em String
*/
// 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 {
@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;
<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"
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());
@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... */);