
Bite-sized scripts for everyday use. Tweets will largely cover front-end development technologies: HTML, CSS, and JavaScript. Managed by @jonathansampson
Joined January 2014
- Tweets95
- Following1
- Followers299
- Likes1
MiniScripts retweeted
function shallowEqual(obj1, obj2) {
const keys1 = Object.keys(obj1);
if (keys1.length !== Object.keys(obj2).length) return false;
for (const k1 of keys1) {
if (! (k1 in obj2)) return false;
if (obj1[k1] !== obj2[k1]) return false;
}
return true;
}
MiniScripts retweeted
HEX to RGB in a tweet
let hex = '#c71585';
let rgb = `rgb(${hex.match(/[0-9a-f]{2}/gi).map(c => parseInt(c, 16)).join()})`;
#js
MiniScripts retweeted
Now in @brave: Search GitHub, MDN, Stack Overflow from the address bar:
:gh brave
:m spread
:s reactjs
{'🦁':'Developers'.repeat(3)+'!'}
MiniScripts retweeted
Speak to me, Browser.
var a = "Hello, friend.";
speechSynthesis.speak(
new SpeechSynthesisUtterance(a)
);
Edge 14, Firefox 49, Chrome 33
MiniScripts retweeted
ES6 array of numbers:
const range = (start, end) => (
Array.from({ length: end - start + 1 }, (x, i) => i + start)
);
#JavaScript #es6
MiniScripts retweeted
Unicode code point escape syntax, recently added in JavaScript 2015, also found its way into PHP 7. This makes me very happy.
\u{2661} ♡
MiniScripts retweeted
Bug: The valueAsNumber property on input elements may not work properly in Internet Explorer. Here's a quick shim: gist.github.com/jonathansamp…
MiniScripts retweeted
GIFtorial: Update element contents every second from next index in array. i.stack.imgur.com/mLojE.gif
MiniScripts retweeted
GIFtorial: CSS Counters twitpic.com/dzjqsd




