Skip to content

Instantly share code, notes, and snippets.

View brendomaciel's full-sized avatar

Brendo Maciel brendomaciel

  • Else Consultoria
  • Brazil
View GitHub Profile
@brendomaciel
brendomaciel / flot_tooltip.js
Created March 10, 2018 15:00
Bootstrap tooltip on Flot chart
var previousPoint = null;
$("#selector").on("plothover", function(event, pos, item) {
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
@brendomaciel
brendomaciel / .gitconfig
Last active November 16, 2019 19:20
Git aliases
[alias]
history = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
remove = reset HEAD --
restore = checkout --
rollback = reset --soft HEAD~1
@brendomaciel
brendomaciel / useClassName.js
Last active September 20, 2021 21:32
React Hook for simulate Vue's class name features
const useClassName = (...args) => {
const parse = (classNames) => {
let actualClassNames = [];
if ('string' === typeof classNames) {
actualClassNames.push(classNames);
}
else if (Array.isArray(classNames)) {
for (const className of classNames) {
actualClassNames = actualClassNames.concat(parse(className));
const helpMeTo = {
get: {
entry: {
from: (array) => {
return {
where: (property) => {
return {
equalsTo: (value) => {
return array.find((item) => item[property] === value);
},
accent: "#80cbc4"
background: "#263238"
foreground: "#eeffff"
details: "darker"
terminal_colors:
bright:
black: "#464b5d"
green: "#c3e88d"
cyan: "#89ddff"
red: "#f07178"