Skip to content

Instantly share code, notes, and snippets.

View deepsweet's full-sized avatar

Kir Belevich deepsweet

View GitHub Profile
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:
@deepsweet
deepsweet / LICENSE.txt
Created May 26, 2011 20:33 — forked from 140bytes/LICENSE.txt
$$ yocto framework
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:
@deepsweet
deepsweet / quiet-grunt-newer
Last active August 29, 2015 14:07
ugly hack to suppress too verbose 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 / private.xml
Last active October 22, 2015 05:58
Karabiner: volume to shift+option+volume
<?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>
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 / .travis.yml
Created January 3, 2016 16:00
headless Chrome and Firefox with Travis
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
@deepsweet
deepsweet / onClickOutside.jsx
Last active June 27, 2018 08:45
"on click outside" with React and Recompose
<div
tabIndex="0"
ref={onRef}
onBlur={onWrapperBlur}
>
// ...
withHandlers(() => {
let element = null;
@deepsweet
deepsweet / how to.md
Created December 6, 2017 10:56
Open fullscreen album cover of current track in iTunes
  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