Skip to content

Instantly share code, notes, and snippets.

View matallo's full-sized avatar

Carlos Matallín matallo

View GitHub Profile
javascript:(function()%7Btry%20%7Bvar%20vizID%20%3D%20window.location.href.match(%2F%5C%2Fbuilder%5C%2F(%5B%5Cda-zA-Z-%5D%2B)%2F)%5B1%5D%3Bvar%20prefix%20%3D%20window.location.href.match(%2F(.*)%5C%2Fbuilder%2F)%5B1%5D%3Bvar%20newURL%20%3D%20prefix%20%2B%20'%2Fapi%2Fv3%2Fviz%2F'%20%2B%20vizID%20%2B%20'%2Fviz.json'%3Bwindow.open(newURL)%3B%7D%20catch(error)%20%7Balert(%22URL%20couldn't%20be%20parsed%22)%7D%7D)()
geo2topo ne_10m_admin_1_states_provinces_copy_copy.geojson untitled_table.geojson -o output.json
<img srcset="http://res.cloudinary.com/matallin/image/upload/ar_16:9,c_fill,w_280/v1526506792/25720441604_9c26662678_o.jpg 280w,
http://res.cloudinary.com/matallin/image/upload/ar_16:9,c_fill,w_360/v1526506792/25720441604_9c26662678_o.jpg 360w,
http://res.cloudinary.com/matallin/image/upload/ar_16:9,c_fill,w_520/v1526506792/25720441604_9c26662678_o.jpg 520w,
http://res.cloudinary.com/matallin/image/upload/ar_16:9,c_fill,w_560/v1526506792/25720441604_9c26662678_o.jpg 560w,
http://res.cloudinary.com/matallin/image/upload/ar_16:9,c_fill,w_720/v1526506792/25720441604_9c26662678_o.jpg 720w,
http://res.cloudinary.com/matallin/image/upload/ar_16:9,c_fill,w_1040/v1526506792/25720441604_9c26662678_o.jpg 1040w"
sizes="(max-width: 560px) 520px, (max-width: 800px) 360px, 280px"
src="http://res.cloudinary.com/matallin/image/upload/v1526506792/25720441604_9c26662678_o.jpg"
alt="{{ post.title }}">
gulp.task('responsive-images', ['html'], () => {
const cloudinaryURL = 'https://res.cloudinary.com/dcuclvhyb/image/upload/';
return gulp.src('dist/**/*.html')
.pipe(plugins.replace(/(\/img\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))(\??([a-zA-Z0-9_:,]*))/g, (match, p1, p2, p3) => {
log(`Found ${match}`);
return `${cloudinaryURL}${p3}/v1526741840/matall.in${p1}`;
}))
.pipe(gulp.dest('dist'));
2
los dos: both | of | us/you/them
ninguno: neither | of | us/you/them
cualquiera: either | of | us/you/them
I want both of them to come
I want neither of them to come
I don't want either of them to come
to_json(ARRAY[config])->>0

Keybase proof

I hereby claim:

  • I am matallo on github.
  • I am matallo (https://keybase.io/matallo) on keybase.
  • I have a public key whose fingerprint is 5CC0 A430 62EB 7044 E9C1 20AE 0AD6 01D5 6149 D3AF

To claim this, I am signing this object:

require 'nokogiri'
require 'cgi'
filename = 'export.xml'
xml = File.read(filename)
doc = Nokogiri::XML(xml)
doc.xpath("//Content").each { |node, i|
if node.content != ''
node_str = node.content
unescaped_node_str = CGI.unescapeHTML(node_str)
@matallo
matallo / getDelayFromNetworkSpeed.ts
Created April 25, 2020 18:49 — forked from timc1/getDelayFromNetworkSpeed.ts
Control the speed at which your loading state shows up depending on the user's internet speed.
const defaultDelay = 500;
export default function getDelay(): number {
if (typeof window !== "undefined") {
if (window.navigator && window.navigator.connection) {
const connection = window.navigator.connection.effectiveType;
switch (connection) {
case "4g":
return defaultDelay;
case "3g":