Skip to content

Instantly share code, notes, and snippets.

View ramasilveyra's full-sized avatar
πŸ•

Ramiro Silveyra d'Avila ramasilveyra

πŸ•
View GitHub Profile
@ramasilveyra
ramasilveyra / API.md
Created October 4, 2017 07:35 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@ramasilveyra
ramasilveyra / find-different-modules-webpack-1-2.js
Last active May 22, 2017 15:29
webpack 1 and webpack 2 module resolver has some differeces, use this to find the modules that differs
'use strict';
const webpack1Stats = require('./webpack1-stats.json');
const webpack2Stats = require('./webpack2-stats.json');
const modules = new Set();
webpack1Stats.modules.forEach((wModule) => {
modules.add(wModule.name);
});
@ramasilveyra
ramasilveyra / list-duplicate-deps-npm-shrinkwrap.js
Last active May 22, 2017 15:30
List duplicated deps on the npm-shrinkwrap.json
'use strict';
const shrinkwrap = require('./npm-shrinkwrap.json');
const modules = {};
const duplicatedModules = {};
walk(shrinkwrap, (key, body) => {
if (!modules[key]) {
modules[key] = [body.version];
return;
@ramasilveyra
ramasilveyra / README.md
Last active November 6, 2016 06:55
Preload/prefetch JS files (for code splitting and async routes)

Preload/prefetch JS files (for code splitting and async routes)

Preload/prefetch JS files techniques to avoid waterfall when you split the main bundle in chunks (async routes).

Results of chunks files

Approach JS executed Loaded as Support
link rel preload as script false JS File -
link rel prefetch false File +
blockquote.twitter-tweet {
overflow: hidden;
color: #1c2022;
background-color: #fff;
border: 1px solid #e1e8ed;
border-radius: 4px;
width: 500px;
max-width: 100%;
min-width: 220px;
padding: 1.25rem 1.25rem 0.725rem 1.25rem;
@ramasilveyra
ramasilveyra / .eslintrc
Created December 16, 2015 00:20
Multiple bundles with browserify and watchify on gulp. Plus ES2015 support with babelify and sourcemaps, linter with eslint
{
"extends": "airbnb",
"rules": {
"comma-dangle": 0
}
}
@ramasilveyra
ramasilveyra / sm-annotated.html
Created November 6, 2015 19:27 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@ramasilveyra
ramasilveyra / inscribidor-automatico-siu.js
Last active March 13, 2025 21:45
Inscribidor automΓ‘tico a materias del SIU GuaranΓ­
/*
* Inscribidor automΓ‘tico a materias del SIU GuaranΓ­
*/
/*
* En la pΓ‘gina de la materia a la que queres inscribirte abrΓ­ la consola del
* navegador y pega el siguiente cΓ³digo. Acordarte de cambiar el cΓ³digo de
* comisiΓ³n por el deseado en la primera variable.
*/
@ramasilveyra
ramasilveyra / base-wp-functions.php
Last active June 16, 2024 07:12
My base functions extras for any WordPress themes that I develop
<?php
/**
* Logitud de the_excerpt() a 25 palabras
*/
function ramasilveyra_custom_excerpt_length( $length ) {
return 25;
}
add_filter( 'excerpt_length', 'ramasilveyra_custom_excerpt_length', 999 );
/**
@ramasilveyra
ramasilveyra / doubletaptogo.js
Last active August 29, 2015 14:16
Drop-Down Navigation: Responsive and Touch-Friendly
/*
* By Osvaldas Valutis, www.osvaldas.info
* Available for use under the MIT License
*
* With minor syntax improvements to approve JsLint. (Ramiro Silveyra d'Avila - https://ramasilveyra.com.ar/)
*/
(function ($, window, document) {
'use strict';
$.fn.doubleTapToGo = function () {
if (typeof (window.ontouchstart) === 'undefined' && !navigator.msMaxTouchPoints && !navigator.userAgent.toLowerCase().match(/windows phone os 7/i)) {