Skip to content

Instantly share code, notes, and snippets.

@mminguezz
mminguezz / sticky.js
Created August 29, 2018 10:36 — forked from javierarques/sticky.js
Sticky Sideabr With Vanilla Javascript. Detects scroll and set fixed the element. Live example: http://codepen.io/javiarques/pen/vKdgjR
// Sticky Nav Component
var Sticky = (function() {
'use strict';
var CSS_CLASS_ACTIVE = 'is-fixed';
var Sticky = {
element: null,
position: 0,
addEvents: function() {
@mminguezz
mminguezz / .editorconfig
Last active December 27, 2017 10:01 — forked from JamesMGreene/.editorconfig
Example EditorConfig file
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org
# Find Plugin
# http://editorconfig.org/#download
# Install tools
# ```npm install -g editorconfig-tools```
# run ```editorconfig-tools fix **/*```
@mminguezz
mminguezz / dabblet.css
Created April 25, 2017 16:58 — forked from oli/dabblet.css
calc() and attr() tests
/* calc() and attr() tests */
span {outline: 1px solid #ccc;}
.a {font-size: 2em;}
.aa {font-size: calc(1em * 2);}
body {margin: 0;}
p {margin-left: 1.5em;}
.wrapper {padding-top: 2em; clear: left;}
.content {
@mminguezz
mminguezz / test.php
Created March 22, 2016 10:38
Pre parse underscore JS templates with PHP
<?php
$string = '
<div class="page-nav-header">
<h1>Compose</h1>
<ul class="nav nav-tabs">
<li id="type-email"<%= compose_type == \'email\' ? \' class="active"\' : \'\' %>><a href="#" class="email change-type-email">E-mail</a></li>
<li id="type-twitter"<%= compose_type == \'twitter\' ? \' class="active"\' : \'\' %>><a href="#" class="twitter change-type-twitter">Twitter</a></li>
</ul>
<br clear="all" />
</div>
@mminguezz
mminguezz / notes.md
Created February 1, 2016 08:10 — forked from paulirish/webfont-performance-notes.md
webfont performance notes

Just jotting some notes on delivering webfonts performantly…

still an incomplete draft.

basics

  • identify which fonts you NEED for the first render (A), and which you dont (B)
  • you want the network reqs for A to start ASAP. ideally the @font-face req is in a style tag, following CRP guidelines
  • you can use the upcoming preload if you know the font URL ahead of time.