• Blog
  • Bookmarks
  • RSS
  • What’s my setup?

Ricard Torres Code

HTML, CSS and JavaScript

JavaScript

February 14, 2017 by Ricard Torres

How to lose focus on input field with JavaScript

Specially useful when you’re on mobile and need to hide the phone keyboard…

Posted in JavaScript
How to lose focus on input field with JavaScript
June 3, 2016 by Ricard Torres

Debounce Window resize callbacks in JavaScript

Use a debounce function when listening to a window resize event in JavaScript otherwise you’ll site be very slow, bad UX or even crash the browser…

Posted in JavaScript
Debounce Window resize callbacks in JavaScript
May 30, 2016 by Ricard Torres

Clean characters from input type number – Angular

Use a custom Angular directive to clean an input field to allow only number…

Posted in JavaScript
Tagged AngularJS
Clean characters from input type number – Angular
April 5, 2016 by Ricard Torres

Trigger after ng-repeat has finished – Angular

Fire an event after the ng-repeat has finished in Angular. If you need to trigger a third party jQuery plugin or anything for that matter…

Posted in JavaScript
Tagged AngularJS
Trigger after ng-repeat has finished – Angular
March 23, 2016 by Ricard Torres

How to make Angular work with Jinja templates

Use Angular template with curly braces inside Jinja templates…

Posted in JavaScript
Tagged AngularJS
How to make Angular work with Jinja templates
December 22, 2015 by Ricard Torres

React two way data binding with LinkedStateMixin

Add two way data binding in React using it’s own addons library…

Posted in JavaScript
React two way data binding with LinkedStateMixin
December 21, 2015 by Ricard Torres

Create loop inside React JSX

Use the map function to loop through an empty array inside a react component. Very useful but no so intuitive…

Posted in JavaScript
Tagged React
Create loop inside React JSX
December 16, 2015 by Ricard Torres

Use Babel to compile React JSX with Grunt

Trasnform your .jsx files to regular .js files with Grunt and Babel, the JavaScript compiler…

Posted in JavaScript
Tagged Grunt, React
Use Babel to compile React JSX with Grunt
October 8, 2015 by Ricard Torres

Disable Chrome form autocomplete

Google Chrome ignores the autocomplete=”off” or automcomplete=”false” in forms, use a readonly attribute…

Posted in HTML, JavaScript
Tagged Google Chrome
Disable Chrome form autocomplete
August 11, 2015 by Ricard Torres

JavaScript window resize callback with timeout

Short snippet to run code after the user resizes the browser window. Timeout takes care of excessive calls…

Posted in JavaScript
JavaScript window resize callback with timeout
« Previous
Next »

Categories

  • Apache (15)
  • CSS (38)
  • Gatsby (5)
  • HTML (17)
  • Hugo (3)
  • JavaScript (66)
  • Linux (26)
  • Mac (9)
  • Magento (44)
  • MySQL (6)
  • NGINX (4)
  • Node.js (7)
  • PHP (27)
  • WordPress (96)

RSS Ricard Torres Blog

  • Twitter Notes, but why?
  • Barcelona’s shameful public transport system
  • Flying
  • Weeknote 22 (2022)
  • Taking notes: paper? digital?

RSS Korean Tapas

  • Episode 18: Top spots in South Korea
  • Episode 17: eSports
  • Episode 16: Travel
  • Episode 15: Military culture
  • Episode 14: I love trains

Sharing code since 2010

@ricard_dev

@ricard_dev@mastodon.technology

4.587.514 post views so far.

© Ricard Torres Code - 2022