Skip to content

Instantly share code, notes, and snippets.

View ericviana's full-sized avatar

Eric Viana ericviana

View GitHub Profile
@ericviana
ericviana / ABOUT.json
Last active October 8, 2023 17:16
Projects 👋
{
"Fros": "www.fros.dev",
"Raunt": "www.raunt.app",
"Crafta": "www.crafta.studio"
}
@ericviana
ericviana / gist:8220fd62abc32870748728ae064443df
Last active July 9, 2024 15:21
Weekly development breakdown 📊
SWIFT 17 hrs 15 mins ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⣀⣀⣀⣀⣀ 73.70 %
METAL 7 hrs 45 mins ⣿⣿⣿⣿⣿⣷⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀ 23.59 %
PROTO 54 mins ⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀ 01.24 %
SVELTE 14 mins ⣄⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀ 00.75 %
RUST 12 mins ⣄⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀ 00.65 %
Other 1 min ⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀ 00.07 %
import axios from "axios";
axios.get('https://api.github.com/users/ericviana')
.then (response => axios.get(response.data.repos_url))
.then (repos => console.log(repos.data))
.catch (error => console.log(error))
import axios from 'axios'
async function fetchRepos () {
try {
const user = await axios.get('https://api.github.com/users/ericviana')
const repos = await axios.get(user.data.repos_url)
console.log(repos)
} catch (e) {
console.log(e)
@ericviana
ericviana / background-grid.css
Last active December 19, 2022 13:58
Background grid with pure Css
body {
background-size: 40px 40px;
background-image:
linear-gradient(to right, grey 1px, transparent 1px),
linear-gradient(to bottom, grey 1px, transparent 1px);
}
@ericviana
ericviana / cool-backgrond.css
Created December 23, 2022 13:38
Grid with meshed gradient
.main {
width: 100vw;
min-height: 100vh;
position: fixed;
display: flex;
justify-content: center;
padding: 120px 24px 160px 24px;
pointer-events: none;
}
@ericviana
ericviana / settings.json
Created February 17, 2023 20:36
Minimal Vscode
{
"workbench.layoutControl.enabled": false,
"workbench.editor.tabSizing": "shrink",
"workbench.editor.limit.perEditorGroup": true,
"window.commandCenter": true,
"breadcrumbs.enabled": false,
"workbench.editor.showTabs": false,
"editor.minimap.autohide": true,
"workbench.activityBar.visible": false,
}
@ericviana
ericviana / dijkstra.js
Created June 23, 2023 15:18
Dijkstra's Shortest Path Algorithm
function dijkstra(graph, startNode) {
const distances = {};
const visited = {};
const queue = [];
distances[startNode] = 0;
queue.push({ node: startNode, distance: 0 });
while (queue.length > 0) {
queue.sort((a, b) => a.distance - b.distance);
@ericviana
ericviana / binary.js
Created June 23, 2023 15:19
Binary Search
function binarySearch(arr, target) {
let left = 0;
let right = arr.length - 1;
while (left <= right) {
let mid = Math.floor((left + right) / 2);
if (arr[mid] === target) {
return mid;
} else if (arr[mid] < target) {