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 events = ['click', 'touchstart', 'touchmove', 'touchend', 'mousedown', 'mousemove', 'mouseup', 'keydown', 'keyup']; | |
const defaults = { | |
timeout: 5000 | |
}; | |
let timer = null; | |
function BlockUi(context, options) { |
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
#!/bin/bash | |
album=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "album"|egrep -v "album"|egrep -v "array"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$` | |
artist=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "artist"|egrep -v "artist"|egrep -v "array"|cut -b 27-|cut -d '"' -f 1|egrep -v ^$` | |
title=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "title"|egrep -v "title"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$` | |
echo $artist " - " $album " - " $title; |
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
#!/usr/bin/env bash | |
# Created @ 13.01.2015 by Christian Mayer <http://fox21.at> | |
brew install dbus | |
cp /usr/local/Cellar/d-bus/1.8.8/org.freedesktop.dbus-session.plist ~/Library/LaunchAgents | |
# Load DBus | |
launchctl load -w ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist |
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 scrollHeight() { | |
const body = document.body; | |
const html = document.documentElement; | |
return Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); | |
} |
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
let tabbables; | |
function setTabbable(e) { | |
if (e.keyCode === 9) { | |
e.preventDefault(); | |
// the tabbable elements can be changed. | |
tabbables = Array.prototype.slice.call(tabbable(this.currentStepView)); | |
const isFocused = tabbables.some((item, i) => { |
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
<a href="http://stackoverflow.com/questions/9804280/how-to-prevent-focus-event-in-ie-when-mousedown-happens/17525223#17525223">http://stackoverflow.com/questions/9804280/how-to-prevent-focus-event-in-ie-when-mousedown-happens/17525223#17525223</a> | |
<br /> | |
<input type="text" id="name"> | |
<div onmousedown="return false" unselectable="on" id="suggest"> | |
<div unselectable="on">mark</div> | |
<div unselectable="on">sam</div> | |
<div unselectable="on">john</div> | |
</div> |
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
import scrollParent from './scrolll-parent.js'; | |
if (/Android [4-6]/.test(navigator.appVersion)) { | |
window.addEventListener('resize', () => { | |
if (document.activeElement.tagName === 'INPUT') { | |
window.setTimeout(() => { | |
const el = document.activeElement; | |
const rect = el.getBoundingClientRect(); | |
const container = scrollParent(el); |
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 regex = /(auto|scroll)/; | |
const parents = function (node, ps) { | |
if (node.parentNode === null) { return ps; } | |
return parents(node.parentNode, ps.concat([node])); | |
}; | |
const style = function (node, prop) { | |
return getComputedStyle(node, null).getPropertyValue(prop); |
NewerOlder