Skip to content

Instantly share code, notes, and snippets.

View pedronauck's full-sized avatar
:electron:

Pedro Nauck pedronauck

:electron:
View GitHub Profile
@pedronauck
pedronauck / conventions.md
Created August 27, 2015 04:44
Development work convetions

Convenções para Git

Principal Convenção: todos as mensagens referente a qualquer ação dentro do versionamento deverá ser feita em Inglês, seguindo as próximas convenções.

Razão: Inglês é a lingua internacional. Um dia você pode acabar desenvolvendo junto com a algum developer de outro país, escrever em uma linguagem universal ajudaria muito nessa situação.

Commits

  • Mensagens de commit devem ser escritos sempre no imperativa, nunca usar uma mensagem escrita no passado ou no presente.
  • Devem ser escrito apenas com lowercase.
@pedronauck
pedronauck / README.md
Created May 14, 2013 02:17 — forked from zenorocha/README.md
Sample file for README.md

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@pedronauck
pedronauck / del_branch.fish
Last active October 28, 2023 01:04
Functions to remove branchs that was merged but not deleted
#
# filepath ~/.config/fish/functions/del_branch.fish
#
function del_branch --argument name
for name in $argv
# Check if the branch exists locally
set -l local_exists (git rev-parse --verify --quiet $name)
# Check if the branch exists remotely
@pedronauck
pedronauck / git.md
Created May 14, 2013 15:09
Terminal commands

Comandos Gerais

Clonar um Repositório

$ git clone 'nome-do-repositório'

Verificar status

$ git status
@pedronauck
pedronauck / Header.tsx
Created July 11, 2020 00:11
Tailwind, PostCSS, Styled-JSX and NextJS
import React from 'react'
import { Link } from 'systems/Core/Link'
import css from 'styled-jsx/css'
export const Header = () => {
return (
<header className="Root">
<img src="/logo.svg" width={100} />
<div className="MainMenu">
<ul className="MenuList">
@pedronauck
pedronauck / useHotkeys.ts
Created December 11, 2018 02:03
usePopper and useHotkeys hooks
import { useEffect } from 'react'
import hotkeys from 'hotkeys-js'
export const useHotkeys = (key: string, cb: () => any, inputs?: any[]) => {
useEffect(() => {
hotkeys(key, cb)
return () => hotkeys.unbind(key)
}, inputs)
}
@pedronauck
pedronauck / reset.css
Created June 20, 2022 19:24 — forked from EllyLoel/reset.css
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
@pedronauck
pedronauck / Subscribe.tsx
Created July 11, 2020 18:52
Tailwind (with twin.macro), Emotion, NextJS and ChakraUI
/** @jsx jsx */
import { jsx, css } from '@emotion/core'
import tw from 'twin.macro'
import { Button, Input } from 'systems/Core'
export const Subscribe: React.FC = () => {
return (
<div css={styles.Root}>
<h4>Subscribe to our newsletter</h4>
@pedronauck
pedronauck / model.js
Last active April 23, 2020 20:21
Model file for mongoose
'use strict';
var mongoose = require('mongoose'),
timestamp = require('timestamp'),
Schema = mongoose.Schema,
ObjectId = Schema.Types.ObjectId;
var ModelSchema = new Schema({
name: { type: String }
});
import { combineReducers } from 'redux';
// Define the context to search files
const CONTEXT = require.context('./', true, /\.\/(.*)\/index.js?$/i);
// Populate a object with the reducer
const importReducer = (req) => (obj, path) => {
const [, componentName] = path.match(/\.\/(.*)\/index.js?$/i);
const reducer = {
[componentName]: req(path).default