Skip to content

Instantly share code, notes, and snippets.

View the-glima's full-sized avatar
🎧
Helping robots to steal all jobs

Gabriel Lima the-glima

🎧
Helping robots to steal all jobs
View GitHub Profile
@the-glima
the-glima / FE - NexChallenge - HTML
Last active May 2, 2022 20:47
NexHealth: Front-end Challenge HTML
<!-- https://codesandbox.io/s/fe-code-challenge-example-52iitk -->
<!DOCTYPE html>
<html>
<head>
<title>NexHealth Code Challenge</title>
<meta charset="UTF-8" />
</head>
<body>
@the-glima
the-glima / FE - NexChallenge Data
Last active May 6, 2022 17:36
NexHealth: Front-end Challenge Data
[
{
"id":1,
"inst_id":1,
"loc_id":1,
"appointment":{
"activity_type":"survey-created",
"created_at":"2021-01-19T19:12:31Z",
"actor_name":"John Smith",
"link":"https://app.nexhealth.com/app/surveys",
@the-glima
the-glima / FE - NexChallenge Style
Last active May 6, 2022 17:40
NexHealth: Front-end Challenge CSS
/* Reset */
li {
list-style: none;
}
ul {
margin: 0;
padding: 0;
}
@the-glima
the-glima / FE - NexChallenge Part B
Last active May 2, 2022 20:49
NexHealth: Front-end Challenge JS Part B
// CodeSandbox: https://codesandbox.io/s/fe-code-challenge-example-52iitk
// Part B - Solution
import "./styles.css";
import * as partA from "./part-a.js";
// Append
const appendDupes = (group, wrapper) => {
const listItems = sortByDate(group[1]).map(buidlCard).join("");
@the-glima
the-glima / FE - NexChallenge Part A
Last active May 6, 2022 17:41
NexHealth: Front-end Challenge JS Part A
const URL = "https://run.mocky.io/v3/c4b1255a-2251-42fd-adbf-bc92f9a391e7";
// Get the data
const getData = async () =>
fetch(URL)
.then((response) => response.json())
.then((data) => data)
.catch((error) => console.log(error));
// Part A Solution
@the-glima
the-glima / liga-dupes.js
Last active December 27, 2023 02:19
Liga finding duplicates
// Find Duplicate Cards
var cards = $('.cardtitle').toArray()
var cardTitles = cards.map(c => c.innerText)
var toFindDuplicates = array => array.filter((item, index) => array.indexOf(item) !== index)
var duplicateElements = toFindDuplicates(cardTitles);
var findDiff = (array, array2) => array.filter(i => !array2.includes(i));
var findStore = (store) => {
return $$('.estoque-linha .e-col1 > img').find(item => {
var storeName = item.getAttribute('title')
var regex = new RegExp(store,'gi')
console.log(storeName, storeName.match(regex))
console.log(regex)
if (storeName.match(regex))
return item
@the-glima
the-glima / git-diff-files.sh
Created May 25, 2021 12:23
Git Diff Files
#!/usr/bin/env bash
main() {
while getopts ':e:c:h:' opt
do
case $opt in
e) extention="$OPTARG" ;;
c) command="$OPTARG" ;;
h) commit_hash="$OPTARG" ;;
*) echo "Wrong option: ${1}." exit 1;;
# Bash best practices and style-guide
Just simple methods to keep the code clean.
Inspired by [progrium/bashstyle](https://github.com/progrium/bashstyle) and [Kfir Lavi post](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/).
## Quick big rules
* All code goes in a function
* Always double quote variables
@the-glima
the-glima / stimulus.md
Created March 9, 2021 13:13 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet