Skip to content

Instantly share code, notes, and snippets.

Carlos Araya caraya

Block or report user

Report or block caraya

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
@caraya
caraya / webstoemp-gulpfile.js
Created Jan 24, 2020 — forked from jeromecoupe/webstoemp-gulpfile.js
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
View webstoemp-gulpfile.js
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
View query.sql
-- Trying to figure out if this query is correct
-- and whether there are wasy to optimize it soo it
-- won't take as long as it does to run and produce results
SELECT
_TABLE_SUFFIX AS yyyymm,
SUM(fcp.density) AS average_fcp,
SUM(fp.density) as average_fp,
SUM(dcl.density) as average_dcl
FROM
`chrome-ux-report.country_cl.*`,
@caraya
caraya / scripts-to-footer-exclude-amp.php
Created Dec 4, 2019 — forked from westonruter/scripts-to-footer-exclude-amp.php
Exclude all AMP scripts from being moved to the footer by the Scripts To Footer plugin. All AMP scripts have async anyway so they do not need to be moved to the footer for performance.
View scripts-to-footer-exclude-amp.php
View gulpfile.js
/* eslint-disable require-jsdoc */
/* eslint-disable valid-jsdoc */
'use strict';
// Require Gulp first
const gulp = require('gulp');
// packageJson = require('./package.json'),
// Load plugins
const $ = require('gulp-load-plugins')({
lazy: true,
@caraya
caraya / displacement.html
Created Mar 25, 2019 — forked from akella/displacement.html
svg displacement animation
View displacement.html
<filter id="displacement" filterUnits="objectBoundingBox">
<feTurbulence type="turbulence" baseFrequency="0.01" numOctaves="2" result="turb"/>
<feColorMatrix in="turb" result="huedturb" type="hueRotate" values="90">
<animate attributeType="XML" attributeName="values" values="0;180;360" dur="6s" repeatCount="indefinite"/>
</feColorMatrix>
<feDisplacementMap in="SourceGraphic" in2="huedturb" scale="20" result="displace" xChannelSelector="B"/>
<feOffset dx="-5" dy="-5" in="displace" result="unoffsetdisplace"/>
</filter>
View article-template.css
/* Monospaced font for code samples */
@font-face {
font-family: "notomono_regular";
src: url("../fonts/notomono-regular.eot");
src: url("../fonts/notomono-regular.eot?#iefix") format("embedded-opentype"), url("../fonts/notomono-regular.woff2") format("woff2"), url("../fonts/notomono-regular.woff") format("woff"), url("../fonts/notomono-regular.ttf") format("truetype"), url("../fonts/notomono-regular.svg#notomono_regular") format("svg");
font-weight: normal;
font-style: normal;
}
/* Regular font */
@font-face {
View article-template.css
/* Monospaced font for code samples */
@font-face {
font-family: "notomono_regular";
src: url("../fonts/notomono-regular.eot");
src: url("../fonts/notomono-regular.eot?#iefix") format("embedded-opentype"), url("../fonts/notomono-regular.woff2") format("woff2"), url("../fonts/notomono-regular.woff") format("woff"), url("../fonts/notomono-regular.ttf") format("truetype"), url("../fonts/notomono-regular.svg#notomono_regular") format("svg");
font-weight: normal;
font-style: normal;
}
/* Regular font */
@font-face {
@caraya
caraya / lazy-video-loader.js
Created Mar 5, 2019 — forked from benrobertsonio/lazy-video-loader.js
Lazy Loading Video Based on Connection Speed
View lazy-video-loader.js
class LazyVideoLoader {
constructor() {
this.videos = [].slice.call(document.querySelectorAll('.hero__bgvideo'));
// Abort when:
// - The browser does not support Promises.
// - There no videos.
// - If the user prefers reduced motion.
// - Device is mobile.
if (
@caraya
caraya / README.md
Created Feb 24, 2019 — forked from CodingDoug/README.md
Realtime Database triggers with Cloud Functions for Firebase - source
View README.md

Realtime Database triggers with Cloud Functions for Firebase - source

This gist contains the source code in my video series about Realtime Database triggers. You can watch the three parts here:

  1. Part 1 (intro, onCreate)
  2. Part 2 (onUpdate, infinite loops)
  3. Part 3 (onDelete, transactions)

index.ts contains the Cloud Functions code, and dialog.ts contains the script to run

@caraya
caraya / article.tex
Last active Feb 23, 2019
Latex example to go with article
View article.tex
\documentclass[12pt, letterpaper, titlepage]{article}
% font size could be 10pt (default), 11pt or 12 pt
% paper size could be letterpaper (default), legalpaper, executivepaper,
% a4paper, a5paper or b5paper
% side could be oneside (default) or twoside
% columns could be onecolumn (default) or twocolumn
% graphics could be final (default) or draft
%
% titlepage could be notitlepage (default) or titlepage which
% makes an extra page for title
You can’t perform that action at this time.