Profile | download (kb/s) | upload (kb/s) | latency (ms) |
---|---|---|---|
Native | 0 | 0 | 0 |
GPRS | 50 | 20 | 500 |
56K Dial-up | 50 | 30 | 120 |
Mobile EDGE | 240 | 200 | 840 |
2G Regular | 250 | 50 | 300 |
2G Good | 450 | 150 | 150 |
3G Slow | 780 | 330 | 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I'll be doing another one for Linux, but this one will give you | |
# a pop up notification and sound alert (using the built-in sounds for macOS) | |
# Requires https://github.com/caarlos0/timer to be installed | |
# Mac setup for pomo | |
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\ | |
-title 'Work Timer is up! Take a Break 😊'\ | |
-appIcon '~/Pictures/pumpkin.png'\ | |
-sound Crystal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add all the elements inside modal which you want to make focusable | |
const focusableElements = | |
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'; | |
const modal = document.querySelector('#exampleModal'); // select the modal by it's id | |
const firstFocusableElement = modal.querySelectorAll(focusableElements)[0]; // get first element to be focused inside modal | |
const focusableContent = modal.querySelectorAll(focusableElements); | |
const lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object.prototype.toString.call() will check the type of any primitive or object in JavaScript: | |
console.log(Object.prototype.toString.call(new Date())) // [object Date] | |
console.log(Object.prototype.toString.call([])) // [object Array] | |
console.log(Object.prototype.toString.call(true)) // [object Boolean] | |
console.log(Object.prototype.toString.call(function () {})) // [object Function] | |
console.log(Object.prototype.toString.call((x => x))) // [object Function] | |
console.log(Object.prototype.toString.call(null)) // [object Null] | |
console.log(Object.prototype.toString.call(37)) // [object Number] | |
console.log(Object.prototype.toString.call(NaN)) // [object Number] | |
console.log(Object.prototype.toString.call(Infinity)) // [object Number] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"globals": { | |
"jQuery": true, | |
"$": true | |
}, | |
"env": { | |
"browser": true, | |
"node": true | |
}, | |
"rules": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mvt:comment> | |
Overrides if needed | |
</mvt:comment> | |
<mvt:assign name="l.run:override_from" value="''" /> | |
<mvt:assign name="l.run:override_reply_to" value="''" /> | |
<mvt:assign name="l.run:override_to" value="''" /> | |
<mvt:assign name="l.run:override_cc" value="''" /> | |
<mvt:assign name="l.run:override_bcc" value="''" /> | |
<mvt:assign name="l.run:override_subject" value="''" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mvt:assign name="l.settings:layout_code" value="'sfnt_layout'" /> | |
<mvt:item name="readytheme" param="contentsection( 'components_and_layouts' )" /> | |
<mvt:eval expr="l.settings:final_output" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
There is a huge practical problem with web components spec v1:
In certain cases connectedCallback
is being called when the element's child nodes are not yet available.
This makes web components dysfunctional in those cases where they rely on their children for setup.
See WICG/webcomponents#551 for reference.
To solve this, we have created a HTMLBaseElement
class in our team which serves as the new class to extend autonomous custom elements from.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
entry: path.resolve(__dirname, 'src/index.js'), | |
plugins: [ | |
new webpack.HashedModuleIdsPlugin(), // so that file hashes don't change unexpectedly | |
], | |
output: { | |
path: path.resolve(__dirname, 'dist'), |
NewerOlder