Skip to content

Instantly share code, notes, and snippets.

View marcosrjjunior's full-sized avatar

Marcos RJJunior marcosrjjunior

View GitHub Profile
@marcosrjjunior
marcosrjjunior / outdoors
Last active July 9, 2023 10:47
outdoors
[
{
"type": "alltrails",
"title": "Oeschinen Lake Lookout",
"movingTime": "1h 40m",
"length": "7.1 km",
"elevationGain": "386m",
"createdAt": "June 7, 2023",
"image": "http://alltrails.com/api/alltrails/v3/maps/175121895/profile_photo?size=large&key=3p0t5s6b5g4g0e8k3c1j3w7y5c3m4t8i&show_static_map=yes&static_map_size=396x180",
"url": "https://www.alltrails.com/explore/recording/afternoon-hike-at-oeschinenbahn-heuberg-db2b418"
@marcosrjjunior
marcosrjjunior / listing-and-hashing.md
Created January 10, 2023 03:46
Listing and hashing files from directory sha256

List files from dir

find src/*

Excluding directories

find src/* -not -path "src/dir-name-to-exclude/*"
@marcosrjjunior
marcosrjjunior / date-fns-timezone.ts
Last active September 14, 2023 01:23
date-fns timezone to utc
// zoneName: {country}/{city}
export const zoneTimeToUTC = ({ zoneName }) => {
const now = new Date('2022-12-06T20:12:46+10:00')
const nowTimezone = formatInTimeZone(now, zoneName, 'yyyy-MM-dd HH:mm:ss')
return zonedTimeToUtc(nowTimezone, zoneName).toISOString()
}
@marcosrjjunior
marcosrjjunior / test.json
Last active November 28, 2022 04:19
test
[
{
"id": 1,
"name": "Jennifer Connelly"
},
{
"id": 2,
"name": "Tom Cruise",
"children": [
{
@marcosrjjunior
marcosrjjunior / dgrm
Created September 5, 2022 03:50
url short
#### Idea
- Structure a simple URL shortener. Simple URL and short URL
- Now, what if we want to manage a link for each user
- Ability to store views on the link
- Client is complaining that the link is slow
- Client is still complaining that the link is slow
@marcosrjjunior
marcosrjjunior / React
Last active September 5, 2022 04:08
tst
// DATA
// Initial JSON data
const people = [
{
id: 1,
name: 'Jennifer Connelly'
},
{
id: 2,
name: 'Tom Cruise',
@marcosrjjunior
marcosrjjunior / RedisService.ts
Last active January 22, 2023 19:58
node redis 4.0.4+
import hash from 'object-hash';
import { createClient } from 'redis';
import { config } from '../config';
import { serialize } from '../utils/objectTransformer';
import { log } from '../utils/errors';
export const REDIS_KEY_PREFIX = `PROJECTPREFIX-${config.env?.toLowerCase()}`;
class RedisService {
client: any;
@marcosrjjunior
marcosrjjunior / delete-merged-branchs.sh
Last active February 22, 2022 02:30
Delete merged branchs
#!/usr/bin/env bash
# delete branchs that were merged to main|develop|.....
git branch --merged | egrep -v "(^\*|main|develop|release/1.0.0)" | xargs git branch -d
@marcosrjjunior
marcosrjjunior / webpack.common.js
Last active March 11, 2020 05:58
react simple webpack
// .babelrc
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-class-properties"
]
@marcosrjjunior
marcosrjjunior / loading-with-spinner.html
Created February 18, 2020 23:39
loading-overlay-with-spinner
<div className="loading-overlay">
<div className="bouncing-loader">
<div></div>
<div></div>
<div></div>
</div>
</div>
<style>
.loading-overlay {