Navigation Menu

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 / 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 / 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 / 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 / machine.js
Created December 4, 2019 21:32
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@pedronauck
pedronauck / mix.exs
Created November 1, 2019 03:31 — forked from muziyoshiz/mix.exs
Sample of GraphQL Relay server on Phoenix
# mix.exs
defmodule PhoenixRelaySample.Mixfile do
use Mix.Project
def project do
[app: :phoenix_relay_sample,
version: "0.0.1",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
@pedronauck
pedronauck / Button.tsx
Last active April 15, 2019 18:57
Beauty Button
import * as React from 'react'
import rem from 'polished/lib/helpers/rem'
import styled from 'styled-components'
import * as t from 'PRIVATE_PACKAGE'
import { Icon } from '../Icon'
import { useSpinner } from '../hooks/useSpinner'
import * as appearances from './appearances'
export const scales = {
@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 / rescss.jsx
Created April 24, 2018 21:01
lib to add responsive css-in-js
import styled from 'react-emotion'
import { rescss } from 'rescss'
const mq = resprops([
'@media(min-width: 420px)',
'@media(min-width: 920px)',
'@media(min-width: 1120px)'
])
const Text = styled('div')`
import React from 'react'
import pose from 'react-pose'
const AnimatedDiv = pose('div')({
opened: { scale: 1 },
closed: { scale: 2 },
})
export const MyComponent = ({ opened }) => (
<AnimatedDiv state="opened">