MiniScripts (@miniscripts) header
MiniScripts (@miniscripts) profile picture

Bite-sized scripts for everyday use. Tweets will largely cover front-end development technologies: HTML, CSS, and JavaScript. Managed by @jonathansampson

Joined January 2014
Photo by MiniScripts (@miniscripts)Photo by MiniScripts (@miniscripts)Photo by MiniScripts (@miniscripts)Photo by MiniScripts (@miniscripts)Photo by MiniScripts (@miniscripts)Photo by MiniScripts (@miniscripts)Photo by MiniScripts (@miniscripts)Photo by MiniScripts (@miniscripts)Photo by MiniScripts (@miniscripts)
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; }
10
3
1
32
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
5
37
194
MiniScripts retweeted
Now in @brave: Search GitHub, MDN, Stack Overflow from the address bar: :gh brave :m spread :s reactjs {'🦁':'Developers'.repeat(3)+'!'}
4
16
12
Speak to me, Browser. var a = "Hello, friend."; speechSynthesis.speak( new SpeechSynthesisUtterance(a) ); Edge 14, Firefox 49, Chrome 33
7
2
13
ES6 array of numbers: const range = (start, end) => ( Array.from({ length: end - start + 1 }, (x, i) => i + start) ); #JavaScript #es6
9
52
5
147
Unicode code point escape syntax, recently added in JavaScript 2015, also found its way into PHP 7. This makes me very happy. \u{2661} ♡
1
2
GIFtorial: Update element contents every second from next index in array. i.stack.imgur.com/mLojE.gif
1
3
2
GIFtorial: CSS Counters twitpic.com/dzjqsd
5
2
Today's GIFtorial covers JSON.stringify: i.imgur.com/yRnnUUR.gif #JavaScript #JSON #Stringify
1
22
19
Object.prototype.toString.call( window.constructor ); Chrome/Firefox: "[object Function]" Explorer/Opera: "[object Window]" ¯\_(ツ)_/¯
1
1
3