Skip to content

Instantly share code, notes, and snippets.

Avatar

Kir Belevich deepsweet

View GitHub Profile
@deepsweet
deepsweet / how to.md
Created Dec 6, 2017
Open fullscreen album cover of current track in iTunes
View how to.md
  1. Save as ~/Library/iTunes/Scripts/show cover.scpt
  2. Run it from iTunes menu → weird unicode symbol I couldn't find → show cover
  3. Fail and get error message
  4. Allow iTunes to "control your computer" in macOS System Preferences → Security & Privacy → Privacy → Accessibility
  5. Try again
@deepsweet
deepsweet / onClickOutside.jsx
Last active Jun 27, 2018
"on click outside" with React and Recompose
View onClickOutside.jsx
<div
tabIndex="0"
ref={onRef}
onBlur={onWrapperBlur}
>
// ...
withHandlers(() => {
let element = null;
@deepsweet
deepsweet / .travis.yml
Created Jan 3, 2016
headless Chrome and Firefox with Travis
View .travis.yml
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
View isConnectionWorseThan3G.js
function isConnectionWorseThan3G() {
// https://w3c.github.io/netinfo/#dfn-table-of-maximum-downlink-speeds
var mbitsThreshold = 2;
var connection = navigator.connection ||
navigator.mozConnection ||
navigator.webkitConnection;
if (!connection) {
return false;
}
@deepsweet
deepsweet / private.xml
Last active Oct 22, 2015
Karabiner: volume to shift+option+volume
View private.xml
<?xml version="1.0"?>
<root>
<item>
<name>volume to shift+option+volume</name>
<identifier>private.volume_to_shift_option_volume</identifier>
<autogen>
__KeyToKey__
ConsumerKeyCode::VOLUME_UP,
ConsumerKeyCode::VOLUME_UP, ModifierFlag::SHIFT_L | ModifierFlag::OPTION_L
</autogen>
@deepsweet
deepsweet / quiet-grunt-newer
Last active Aug 29, 2015
ugly hack to suppress too verbose grunt-newer
View quiet-grunt-newer
module.exports = function(grunt) {
// https://github.com/tschaub/grunt-newer/issues/52
// https://github.com/gruntjs/grunt/issues/895
var origLogHeader = grunt.log.header;
grunt.log.header = function(msg) {
if (!/newer(-postrun)?:/.test(msg)) {
origLogHeader.apply(this, arguments);
}
};
@deepsweet
deepsweet / LICENSE.txt
Created May 26, 2011 — forked from 140bytes/LICENSE.txt
$$ yocto framework
View LICENSE.txt
Copyright (c) 2011 Kir Belevich, http://soulshine.in
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
View LICENSE.txt
Copyright (c) 2011 Kir Belevich, http://soulshine.in
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
You can’t perform that action at this time.