Skip to content

Instantly share code, notes, and snippets.

View samuelsilvadev's full-sized avatar
🏠
Working from home

Samuel SIlva samuelsilvadev

🏠
Working from home
View GitHub Profile
@jherax
jherax / configure.md
Last active April 25, 2025 10:42
VS Code: Debugging with Jest

VS Code: Debugging Jest

Sometimes, debugging with console.log is not enough to find out what is happening in the code, as console.log prints only plain objects but neither functions nor objects with circular references. Besides, it's possible you may need to know the context and flow of the code.

Read more about debugging with VS Code in VS Code: Debugging.

@marcelgsantos
marcelgsantos / css-gradients.md
Last active February 25, 2018 10:59
Anotações sobre CSS Gradients do artigo do CSS-Tricks

Os exemplos de implementação estão disponíveis no CodePen em https://codepen.io/marcelgsantos/pen/EQRqKP.

  • Pode-se definir o background com uma cor sólida ou gradiente.
  • Recomenda-se a utilização de um gradiente ao invés de uma imagem.
  • O gradiente é quando uma cor varia para outra.
  • Pode-se controlar vários aspectos de um gradiente como a direção e os pontos de mudança da cor.
  • Utiliza-se a propriedade background-color para definir uma cor sólida. Por exemplo: background-color: red.
  • Utiliza-se a propriedade background-image para definir um gradiente. Por exemplo: background-image: linear-gradient(red, orange).

Understanding the JavaScript event loop

If you are someone who has heard about the terms event loop, callback queue, concurrency model and call stack but doesn't really understand what they actually mean, this post is for you. Being said that, if you're an experienced developer this post might help you to understand the internal working of the language and enable you to write more performant user interfaces.

JavaScript as a language has grown exponentially over the past decade and has expanded its reach on various levels of developer stack i.e. frontend, backend, hybrid apps etc. Gone are those days when we used to talk about JavaScript in the context of browsers only. Despite its popularity and growing demand, very few developers actually understand how the language works internally. This post is an attempt to clarify and highlight how JavaScript works and what makes it weird when compared to languages that you might have previously used.

Overview

Unlike languages like C++ or Ruby, JavaScript is a

@heygrady
heygrady / mapDispatchToProps.md
Last active April 5, 2025 08:11
Redux containers: mapDispatchToProps

Redux containers: mapDispatchToProps

This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps argument of the connect function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps can take.

@remarkablemark
remarkablemark / README.md
Last active June 8, 2024 21:48
Classes - ES5 vs ES6

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.

Reference

@rveitch
rveitch / sass-7-1-pattern.scss
Last active June 1, 2025 07:25
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@paulirish
paulirish / what-forces-layout.md
Last active June 8, 2025 22:15
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@stevekinney
stevekinney / front-end-curriculum.md
Created August 9, 2015 00:47
Front-end Curriculum Draft

Module 1

  • Semantic markup
  • HTML standards mode and quirks mode
  • HTML fundamentals
    • Classes and IDs
  • CSS fundamentals
    • Selectors
    • Resets and normalizers
    • The box model
@brenopolanski
brenopolanski / install-firefox-nightly.md
Created July 30, 2014 00:34
Install Firefox Nightly in Ubuntu via PPA

via: http://www.webupd8.org/2011/05/install-firefox-nightly-from-ubuntu-ppa.html

Add the Mozilla Daily PPA (available for Ubuntu 11.04, 10.10 and 10.04) and install Firefox Nightly using the commands below:

$ [sudo] add-apt-repository ppa:ubuntu-mozilla-daily/ppa
$ [sudo] apt-get update
$ [sudo] apt-get install firefox-trunk

Since this is a daily builds PPA, it's nowhere near stable so use it at your own risk!

@staltz
staltz / introrx.md
Last active June 8, 2025 22:15
The introduction to Reactive Programming you've been missing