Skip to content

Instantly share code, notes, and snippets.

Renato de Leão renatodeleao

Block or report user

Report or block renatodeleao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sw-yx
sw-yx / 1.md
Last active Sep 18, 2019
Learn In Public - 7 opinions for your tech career
View 1.md

1. Learn in public

this essay has been updated on my personal site, together with a followup on how to get started

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos or Twitch streams. Start a newsletter. Draw cartoons (people loooove cartoons!). Whatever your thing is, make the thing you wish you had found when you were learni

@leevigraham
leevigraham / example.html
Last active Oct 18, 2018
Renderless Flyout.Vue component
View example.html
<flyout v-cloak>
<div slot-scope="props">
<button
v-on:click="props.toggle()"
v-bind:class="'border-2 p-1 ' + (props.isActive ? 'bg-green': 'bg-red')"
data-reference
>…</button>
<div
v-show="props.isActive"
class="list-reset bg-white border p-4 shadow z-10"
@eirikb
eirikb / .sassrc.js
Created Mar 15, 2018
Demo of parcel + scss
View .sassrc.js
const path = require('path');
const cwd = process.cwd();
module.exports = {
"includePaths": [
path.resolve(cwd, 'node_modules'),
path.resolve(cwd, 'src')
]
};
@sarahdayan
sarahdayan / modifiers.scss
Last active Sep 4, 2019
Sass Modifiers Mixin
View modifiers.scss
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Sass modifiers mixin by Sarah Dayan
// Generate All Your Utility Classes with Sass Maps: frontstuff.io/generate-all-your-utility-classes-with-sass-maps
// http://frontstuff.io
// https://github.com/sarahdayan
View Intersection-observer-script.js
(function () {
// An object with options for the IntersectionObserver.
const options = {
// 0.5 = The callback is fired when 50% of the element is visible
// We can add more values to the array, like 0.25, 0.75 or 1.0
threshold: [0.5]
};
// Instantiate the IntersectionObserver class
const observer = new IntersectionObserver((entries, observer) => {
@taranda
taranda / dynamic-critical-path-css.md
Last active Aug 24, 2019
Dynamically Add Critical CSS to Your Rails App
View dynamic-critical-path-css.md

Dynamically Add Critical CSS to Your Rails App

Optimizing the delivery of CSS is one way to improve user experience, load speed and SEO of your web app. This involves determining the "critical path CSS" and embeding it into the html of your page. The rest of the CSS for the site is loaded asynchronously so it does not block the rendering of your "above the fold" content. This Gist will show you how to dynamically generate critical path CSS for your Rails app.

In this example we will use the mudbugmedia/critical-path-css gem.

Prerequisites

You will need to set up caching and Active Job in your Rails app. I recommend using a thread-safe background job manager like resque.

@simevidas
simevidas / es6-modules-summary.md
Last active Feb 6, 2018
A summary of Jason Orendorff’s Mozilla Hacks post on ES6 modules
View es6-modules-summary.md

ECMAScript Modules

  • modules are automatically strict mode
  • declarations inside a module are scoped to that module (not visible by other scripts)
  • ECMAScript does not define what import does (it’s left up to the implementation)
  • there is no error recovery; “if anything fails to load or link, nothing runs”
  • exporting:
    • you can export any top-level function, class, var, let, or const

@budparr
budparr / jekyll-collections-prev-next.html
Created Dec 9, 2014
Previous Next Links for Jekyll Collections
View jekyll-collections-prev-next.html
{% capture the_collection %}{{page.collection}}{% endcapture %}
{% if page.collection %}
{% assign document = site[the_collection] %}
{% endif %}
<h1>TITLE: {{ page.title }}</h1>
{% for links in document %}
{% if links.title == page.title %}
{% unless forloop.first %}
{% assign prevurl = prev.url %}
{% endunless %}
You can’t perform that action at this time.