Skip to content

Instantly share code, notes, and snippets.

View jmurowaniecki's full-sized avatar
😎
47/53 em 11/09/2024.

John Murowaniecki jmurowaniecki

😎
47/53 em 11/09/2024.
View GitHub Profile
@sandroweb
sandroweb / useLocalStorage
Last active January 11, 2024 22:57
A React Hook to manage LocalStorage items with generic type, with set, refresh and remove actions.
import { useCallback, useMemo, useState } from 'react';
export interface useLocalStorageProps<T> {
id: string;
defaultValue: T;
}
export interface useLocalStorageReturn<T> {
setValue: (value: T) => void;
value: T;
@wilcorrea
wilcorrea / docker-compose.yml
Last active November 24, 2020 19:58
Docker Compose para manter
version: '3.7'
# make sure everything is running with:
# docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}" | grep "nginx-"
#networks
networks:
#network reverse-proxy
reverse-proxy:
external: true
export function magicMethods (clazz) {
// A toggle switch for the __isset method
// Needed to control "prop in instance" inside of getters
let issetEnabled = true
const classHandler = Object.create(null)
// Trap for class instantiation
classHandler.construct = (target, args, receiver) => {
// Wrapped class instance
@lauraturk
lauraturk / circleci-heroku-continuous-deployment2.0.md
Last active November 23, 2021 15:28
instructions for deploying from circleci2.0 to heroku
@callmeloureiro
callmeloureiro / comoSerChatoNoWhatsapp.js
Last active September 23, 2024 19:29
Como fazer alguém te responder no whatsapp
/*
Hoje iremos MUDAR a vida da pessoa que não te responde no whatsappp...
Que tal enviar mensagens pra ela até obter uma resposta?!
Sensacional não acha?! Mas, somos devs, correto?! Então vamos automatizar esse paranauê!
Para utilizar:
- Abra o web.whatsapp.com;
- Selecione a conversa que você quer;
- Abra o console e cole o código que está no gist;
@githubnando
githubnando / windows10-uefi-stick.sh
Last active July 20, 2017 13:55
Make a bootable Windows 10 UEFI USB Stick
# Let the device unmounted
sudo umount /dev/sdb
# Optional: change the content to zeros
sudo dd if=/dev/zero of=THE_DEVICE bs=512 count=1
# Normally this is not nessecary. Then to create a new layout on the drive:
sudo fdisk /dev/THE_DEVICE
# Then:
@githubnando
githubnando / fedora25-afterinstall.sh
Last active October 4, 2017 18:25
Fedora 25|26 Afterinstall - Things TODO
#!/bin/bash
NC='\033[0m'
CO='\033[0;31m'
function display {
echo -e "$CO $1 $NC"
}
display "RPM FUSION FREE AND NONFREE"
@githubnando
githubnando / mysqldump-ignoring-multiple-tables.sh
Last active July 17, 2017 13:49
mysqldump-ignoring-multiple-tables
#!/bin/bash
DB_HOST=""
DB_DATABASE=""
DB_USERNAME=""
DB_PASSWORD=""
read -r -d '' tableSizesQuery << EOF
SELECT
table_schema as 'Database',
@david-mark
david-mark / usestrict.md
Last active December 27, 2023 17:07
'use strict' Considered Pointless and Harmful

'use strict' Considered Pointless and Harmful

What is strict mode?

According to the MDN reference, it is:

ECMAScript 5's strict mode is a way to opt in to a restricted variant of JavaScript [sic].

It goes on to say:

This is a proposal for a lightning talk at the Reactive 2016 conference. If you like this, star the Gist.


Thinking metrics on React applications

In regular websites, it is common to send multiple events to track user clicks. Single Page Applications change the way you look at metrics. This is a talk about a simple pattern we created at Globo.com to manage a metrics layer for http://globoplay.globo.com. The talk will cover how to track user flow using Google Analytics and other services. We solved the challenge of tying metrics and components, keeping information across pages and having global data. Also some React, React Router and React Side Effects concepts like context, higher order components, history state will be covered.