Skip to content

Instantly share code, notes, and snippets.

View gabrieljmj's full-sized avatar
💻
Working from home

Gabriel Jacinto gabrieljmj

💻
Working from home
  • Zig
  • Itajobi, SP, Brazil
View GitHub Profile
@gabrieljmj
gabrieljmj / AbstractRuleSet.php
Created November 19, 2019 17:39
LaravelRuleSets
<?php
namespace App\Rules\RuleSets;
use InvalidArgumentException;
abstract class AbstractRuleSet implements RuleSet
{
/**
* Rules set to combines with.
const isFunction = value => value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
function setTexts({ vars, target, all }) {
all = all || false
for (let varName in vars) {
if (all || vars[varName].set || isFunction(vars[varName].value)) {
console.log('Updating elements for \'' + varName + '\'a')
Array.from(target.querySelectorAll('*[data-text="' + varName + '"]')).forEach(el => {
@gabrieljmj
gabrieljmj / curriculum.md
Last active March 9, 2022 19:41
Curriculum Vitae

Curriculum Vitae

Gabriel Força Jacinto, 23 anos
Desenvolvedor Web
Itajobi, São Paulo
(17) 99623-8089
gamjj74@hotmail.com

Resumo

Venho desde meus 12 anos estudando tecnologias relacionadas à web (cerca de 8 anos). Tenho como principal foco o desenvolvimento principalmente com as linguagens PHP (Orientação a Objetos) e JavaScript. A área mobile também me atrai atualmente, principalmente utilizando React Native.

@gabrieljmj
gabrieljmj / array_compare.js
Created January 18, 2016 22:31
compare arrays
Array.prototype.isEqual = function (arr) {
if (arr.length != this.length || !(arr instanceof Array)) return false;
for (let k = 0, len = this.length; k < len; k++) {
if (this[k] instanceof Array && arr[k] instanceof Array) {
if (!this[k].isEqual(arr[k])) return false;
} else {
if (arr[k] !== this[k]) return false;
}
}
@gabrieljmj
gabrieljmj / oo.php
Last active December 30, 2015 21:25
PHP OO
<?php
class PhpOo
{
public function __call($name, array $args)
{
$cUFA = $this->getName('callUserFuncArray');
return $cUFA($this->getName($name), $args);
}
@gabrieljmj
gabrieljmj / .html
Last active October 28, 2015 01:59
Copy to clipboard without clipboard.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<textarea>:) this is a fuckin' text</textarea>
<button>Copy</button>
<script src="main.js"></script>
@gabrieljmj
gabrieljmj / factorial.js
Created October 23, 2015 18:42
factorial implementation in JS
var factorial = function (number) {
var n = 1;
while(number != 1) {
n = n * number;
number--;
}
return n;
};