This file contains hidden or 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
var session = 25 * 60 * 1000; // pomodoro session | |
var start = Number(new Date()); // set start time | |
var finish = start + session; // set finish time | |
function countdown () { | |
var now = Number(new Date()); | |
var isFinished = (finish - now) > finish; | |
if (!isFinished) { | |
// check after 1 second | |
setTimeout(countdown, 1000); |
This file contains hidden or 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
'use strict'; | |
// Dependencies | |
var Collection = require('./collection'); | |
module.exports = function Singleton (...args) { | |
if (Singleton.instance) { | |
return Singleton.instance; | |
} |
This file contains hidden or 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
var Dispatcher = require('dispatcher'); | |
module.exports = class View extends Backbone.View { | |
constructor(...args) { | |
this.dispatcher = dispatcher.bind(this); // Why? | |
super(...args); | |
} | |
save() { |
This file contains hidden or 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
# rbenv installation | |
$ brew update | |
$ brew upgrade rbenv ruby-build | |
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
# Zsh note: Modify your ~/.zshrc file instead of ~/.bash_profile. | |
# Add rbenv init to your shell to enable shims and autocompletion. | |
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
$ rbenv install 2.2.0 | |
$ rbenv global 2.2.0 | |
$ rbenv rehash |
This file contains hidden or 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
mkdir fiftyfootshadows | |
cd fiftyfootshadows | |
wget -A zip -rH --level=3 -nd \ | |
--domains=files.fiftyfootshadows.net,fiftyfootshadows.net \ | |
http://fiftyfootshadows.net | |
for i in `ls`; do unzip $i; done | |
mv **/*desktop.jpg ~/Pictures | |
cd .. | |
rm -rf fiftyfootshadows |
This file contains hidden or 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
'use strict'; | |
// Dependencies | |
var {Model} = require('backbone'); | |
module.exports = class PluginAdapter extends Model { | |
constructor(parent, options) { | |
this.name = options.name; |
F2
Create a new windowF3
Move to the previous windowF4
Move to the next windowF5
Refresh all status notificationsF6
Detach from the session and logoutShift-F6
Detach from the session, but do not logoutF7
Enter scrollback/search modeF8
Rename the current windowF9
Launch the Byobu Configuration MenuF12
GNU Screen's Escape Key
This file contains hidden or 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
/** | |
* Mixin to use bootstrap media query breakpoints within Sass code: | |
* .profile-pic { | |
* float: left; | |
* width: 250px; | |
* @include media(lg) | |
* width: 100% | |
* @include media(md) | |
* width: 125px; | |
* } |
This file contains hidden or 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
// WTF | |
// Если в скопе вызывается один метод, exec() будет вызван автоматически: | |
db.find(1); // залогирует 1 | |
// Если же в скопе происходит цепочка вызовов, то exec() нужно будет вызывать вручную: | |
db | |
.find(1) | |
.find(2) | |
.find(3) | |
.exec() // Залогирует 123 | |
// или даже так: |