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 / 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
*/
@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 / 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 / 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 / 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) {