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 {
<script type="text/template" id="sub_template">
<article>
<h1>id: <%= id %><h1>
</article>
</script>
<script type="text/template" id="main_template">
<% for (var i = 0; i < num; i++) { %>
<%= renderSub({id:i}) %>
<% } %>
@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>
function isStyleSupported(el, property) {
return el.style[property] != undefined;
}
var testEl = document.getElementById('test');
testEl.innerHTML = (isStyleSupported(testEl, 'flexWrap')) ? "Flex Wrap is supported" : "Flex Wrap is NOT supported";
@mminguezz
mminguezz / notes.md
Created February 1, 2016 08:10 — forked from paulirish/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.
UPDATE wp_options SET option_value = replace(option_value, 'http://origen.es', 'http://www.destino.es');
UPDATE wp_posts SET guid = replace(guid, 'http://origen.es', 'http://www.destino.es');
UPDATE wp_posts SET post_content = replace(post_content, 'http://origen.es', 'http://www.destino.es');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://origen.es', 'http://www.destino.es');
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "single",
h1. Estilo de programación
> Este docuemento esta en desarrollo
Estas reglas pretenden definir el formato y estilo aplicable a los archivos HTML y CSS.
Su objetivo es mejorar la colaboración, la calidad del código y de apoyo para nuevos desarrollos.
Las reglas referentes a CSS estan preparadas pensando en el uso de preprocesadores como LESS ya que los archivos CSS que se usen en producción han de estar minificados.
h2. coding styleguide