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
# study stream aliases | |
# Requires https://github.com/caarlos0/timer to be installed. spd-say should ship with your distro | |
declare -A pomo_options | |
pomo_options["work"]="45" | |
pomo_options["break"]="10" | |
pomodoro () { | |
if [ -n "$1" -a -n "${pomo_options["$1"]}" ]; then | |
val=$1 |
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
/** | |
* Plural forms for russian words | |
* @param {Integer} count quantity for word | |
* @param {Array} words Array of words. Example: ['депутат', 'депутата', 'депутатов'], ['коментарий', 'коментария', 'комментариев'] | |
* @return {String} Count + plural form for word | |
*/ | |
function pluralize(count, words) { | |
var cases = [2, 0, 1, 1, 1, 2]; | |
return count + ' ' + words[ (count % 100 > 4 && count % 100 < 20) ? 2 : cases[ Math.min(count % 10, 5)] ]; | |
} |
With iOS 9 Apple added a Low Power Mode to the iPhone. It extends battery life by stopping some battery heavy features such as email fetch, Hey Siri and background app refresh until you can recharge the device.
It is important to understand that it is the user who decides to enter low power mode. You need to go into the battery settings to turn it on.
To detect LPM you have to be in the couple iOS 9.X / iPhone:
- For iOS 8.X, you need test availablity before use it