Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env node
import path from "path";
import url from "url";
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
console.log({ __dirname });
@techeverri
techeverri / app.js
Last active May 9, 2021 15:34
GitHub avatar search with React Hooks
const { useState, useEffect, useRef } = React;
const GITHUB_USERS_API_URL = "https://api.github.com/users";
const GITHUB_CLIENT_ID = "8b7993e07c6a5750c784";
const GITHUB_CLIENT_SECRET = "fd815b52e8b01fd07995f30ba54f3b799d9ef93e";
const USER_CACHE_MAX_SIZE = 5;
const useCache = (cacheMaxSize) => {
const { current: cache } = useRef(new Map());
@techeverri
techeverri / index.html
Last active July 20, 2019 22:22
Reduce + Spread vs Reduce + Property #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Reduce + Spread vs Reduce + Property #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>

Keybase proof

I hereby claim:

  • I am techeverri on github.
  • I am techeverri (https://keybase.io/techeverri) on keybase.
  • I have a public key ASAGn5uvG8TsvTWk1Dk5G_bRPQ9xFT4N3cEhoC8wGpLdxQo

To claim this, I am signing this object:

@techeverri
techeverri / index.html
Last active July 20, 2019 22:00
math-birthdays
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Math Birthdays</title>
<link rel="stylesheet" href="https://unpkg.com/flatpickr/dist/flatpickr.min.css">
<link rel="stylesheet" type="text/css" href="https://npmcdn.com/flatpickr/dist/themes/material_green.css">
<style>
@techeverri
techeverri / pushbullet-export-pushes.js
Last active July 16, 2021 14:29
Export all pushes from Pushbullet to a JSON
(function () {
'use strict';
var fs = require('fs');
var https = require('https');
var cursor = '';
var pushes = [];
@techeverri
techeverri / .eslintrc.json
Last active July 20, 2019 22:04
Popular Words on Flickr
{
"env": {
"browser": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
4
],
@techeverri
techeverri / app\app.component.css
Last active July 21, 2019 00:35
Angular 2 GitHub Avatar
.github-avatar {
font-family: Roboto, sans-serif;
}
.header {
background-color: #2196F3;
padding: 15px;
color: white;
}
.user-search {
float: right;
@techeverri
techeverri / cancel-shutdown-periodically.cmd
Last active January 21, 2016 15:10
Cancel Windows shutdown periodically
@ECHO OFF
SET /A TIMER = 15
:LOOP
SHUTDOWN /A
TIMEOUT /T
GOTO LOOP