Skip to content

Instantly share code, notes, and snippets.

View mauroreisvieira's full-sized avatar

Mauro Reis Vieira mauroreisvieira

View GitHub Profile
@joshearl
joshearl / SublimeProjectExample.sublime-project
Created November 17, 2012 02:32
Sample Sublime project file with project-specific settings
{
"folders":
[
{
"path": "Leanpub/sublime-productivity",
"folder_exclude_patterns": ["epub_images", "convert_html", "preview", "published"],
"file_exclude_patterns": [".gitignore", "*.sublime*", "*Icon*"]
},
{
"path": "SublimeTextTips"
@wesbos
wesbos / settings.json
Created July 21, 2015 13:46
Wes Bos' Sublime Text Settings
{
"added_words":
[
"Mockup",
"plugins",
"coffeescript",
"sourcemaps",
"html",
"plugin",
"init",
@paulirish
paulirish / what-forces-layout.md
Last active November 15, 2024 16:45
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
var gulp = require('gulp'),
browserSync = require('browser-sync'),
reload = browserSync.reload,
autoprefixer = require('gulp-autoprefixer'),
concat = require('gulp-concat'),
imageMin = require('gulp-imagemin'),
minifyCSS = require('gulp-minify-css'),
notify = require('gulp-notify'),
plumber = require('gulp-plumber'),
sass = require('gulp-sass'),
@adamwathan
adamwathan / belongs-to-many.sublime-snippet
Last active August 3, 2024 16:44
Eloquent Relationship snippets for Sublime Text
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}::class, {$2:table});
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>belt</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!doctype html>
<style>
html, body {
margin: 0;
background-color: #CCC;
box-sizing: border-box;
}
.item {
margin: 20px;
padding: 20px;
@fson
fson / .babelrc
Created June 22, 2016 21:12
A todo app example with frzr and JSX.
{
"plugins": [
"syntax-jsx",
["transform-react-jsx", { "pragma": "frzr.el" }]
],
"presets": ["es2015"]
}
@ebidel
ebidel / fancy-tabs-demo.html
Last active October 30, 2024 14:48
Fancy tabs web component - shadow dom v1, custom elements v1, full a11y
<script src="https://unpkg.com/@webcomponents/custom-elements"></script>
<style>
body {
margin: 0;
}
/* Style the element from the outside */
/*
fancy-tabs {
margin-bottom: 32px;
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const javascript = {
test: /\.(js)$/,
use: [{
loader: 'babel-loader',
options: { presets: ['es2015'] }
}],
@LucaColonnello
LucaColonnello / 1. v-dom.js
Last active April 14, 2020 09:57
Virtual DOM lite implementation
/** @jsx h */
// refs
// https://medium.com/@deathmood/how-to-write-your-own-virtual-dom-ee74acc13060
// https://medium.com/@deathmood/write-your-virtual-dom-2-props-events-a957608f5c76
// test: https://jsfiddle.net/Luca_Colonnello/Lzjy5a67/1/
// comparison:
// current - https://jsfiddle.net/Luca_Colonnello/5xebu97u/3/
// vidom - https://jsfiddle.net/Luca_Colonnello/dp9cwn37/2/