Skip to content

Instantly share code, notes, and snippets.

View dcorb's full-sized avatar

David Corbacho dcorb

View GitHub Profile
@dcorb
dcorb / gist:bdc8b04a649286d316b4e0723cecec21
Created August 6, 2018 20:46
Drupal 8.7.x - yarn run lint:core-js-passing
⋊> ~/d/core on 8.7.x ⨯ yarn run lint:core-js-passing 23:18:25
yarn run v1.6.0
(node:2184) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
$ node ./node_modules/eslint/bin/eslint.js --quiet --config=.eslintrc.passing.json .
/Users/david/drupal/core/misc/active-link.es6.js
27:10 error '?' should be placed at the end of the line operator-linebreak
28:10 error ':' should be placed at the end of the line operator-linebreak
/Users/david/drupal/core/misc/ajax.es6.js
overflow:hidden is needed on html, not only body tag.
native scrolling on overflow:scroll elements with:
-webkit-overflow-scrolling: touch;
translate3d forces HW acc. , use it instead of translateX and translateY
fastclick.js works well to remove click delay
@dcorb
dcorb / speech.js
Last active January 3, 2016 15:09
Demo Speech Synthesis API with Ana Botella
// Result: http://www.youtube.com/watch?v=fxdg31ibQU4
// Experiment mixing English language with Spanish voice.
// It sounds like Ana Botella :)
// This feature is now only in Google Chrome Canary (v. 34)
// Some issues I had building this demo:
// * After 200 characters aprox. the speech will stop
// * It won't work with non ASCII characters
@dcorb
dcorb / map.geojson
Created August 21, 2013 06:58
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dcorb
dcorb / autoexpandcode
Created July 20, 2012 09:57
Auto-expandable code block when hovering. Drupal-ready.
// Effect that I liked from http://gsgd.co.uk/sandbox/jquery/easing/
$.easing.easeOutBack = function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
};
// Credit: http://stackoverflow.com/questions/1582534/calculating-text-width-with-jquery
$.fn.textWidth = function(){
var html_org = $(this).html();