Skip to content

Instantly share code, notes, and snippets.

View matallo's full-sized avatar

Carlos Matallín matallo

View GitHub Profile
RankedOrganicTweet
ActivityTweet
suggestrecycledtweet_inline
suggestpyletweet
suggestactivitytweet
suggest_who_to_follow
suggest_timeline_tweet
suggest_sc_tweet
suggest_recycled_tweet_inline
suggest_recycled_tweet
@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":
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)

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:

to_json(ARRAY[config])->>0
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
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'));
<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 }}">
geo2topo ne_10m_admin_1_states_provinces_copy_copy.geojson untitled_table.geojson -o output.json