This is now an actual repo:
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
after "deploy:symlink", "deploy:restart_workers" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') | |
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}" |
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
# RSpec's subject method, both implicitly and explicitly set, is useful for | |
# declaratively setting up the context of the object under test. If you provide a | |
# class for your describe block, subject will implicitly be set to a new instance | |
# of this class (with no arguments passed to the constructor). If you want | |
# something more complex done, such as setting arguments, you can use the | |
# explicit subject setter, which takes a block. | |
describe Person do | |
context "born 19 years ago" do | |
subject { Person.new(:birthdate => 19.years.ago } | |
it { should be_eligible_to_vote } |
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
after "deploy:symlink", "deploy:restart_workers" | |
after "deploy:restart_workers", "deploy:restart_scheduler" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') |
Идея следующая - загнать футбольные команды в граф, где вершины - команды, а рёбра - показатель того, что в командах есть дублирующиеся игроки, после чего задача сводится к задаче о независимом множестве (http://ru.wikipedia.org/wiki/Задача_о_независимом_множестве).
Картинка:
Там кажется, что 2 и 5 связаны - это не так. 2 и 5 по отдельности связаны с 15-ю.
В коде неоптимально вычисляется пересечение - достаточно самого факта, а вычисляем пересечение целиком. Можно заоптимизировать.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="sample.css"> | |
<title>Sample file to test CSS</title> | |
</head> | |
<body> | |
<div class="main"> | |
<h1 class="center">This is CSS test file.</h1> | |
<div class="center brd background"> |
Moved to git repository: https://github.com/denji/jetbrains-cleanup-backup
Quick uninstall
JetBrains settings:
curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
Quick backup
JetBrains settings:
curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-backup.sh | bash -s
Docker does not run natively on OSX, only Linux. Docker Machine was created to add a Linux VM environment to run Docker containers on OSX. Install using Homebrew:
brew install docker
brew install docker-machine
docker-machine create