Skip to content

Instantly share code, notes, and snippets.

View xentatt's full-sized avatar
💨

Dmytro Uhnichenko xentatt

💨
  • Ukraine, Kyiv
  • 00:14 (UTC +03:00)
View GitHub Profile
@benjamin-smith
benjamin-smith / elasticsearch-local-development-with-docker-osx.md
Last active October 19, 2021 08:01
Develop locally with Elasticsearch on OSX using Docker

Develop locally with Elasticsearch on OSX using Docker

Docker

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
@denji
denji / README.md
Last active April 26, 2024 18:09 — forked from istepanov/gist:3950977
Remove/Backup – settings & cli for macOS (OS X) – DataGrip, AppCode, CLion, Gogland, IntelliJ, PhpStorm, PyCharm, Rider, RubyMine, WebStorm
<!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">
@dmitriy-kiriyenko
dmitriy-kiriyenko / README.md
Created September 10, 2012 04:13
Задача "Легенды футбола"

Идея следующая - загнать футбольные команды в граф, где вершины - команды, а рёбра - показатель того, что в командах есть дублирующиеся игроки, после чего задача сводится к задаче о независимом множестве (http://ru.wikipedia.org/wiki/Задача_о_независимом_множестве).

Картинка:

Там кажется, что 2 и 5 связаны - это не так. 2 и 5 по отдельности связаны с 15-ю.

В коде неоптимально вычисляется пересечение - достаточно самого факта, а вычисляем пересечение целиком. Можно заоптимизировать.

@bkutil
bkutil / deploy.rb
Created December 4, 2011 22:22 — forked from andruby/deploy.rb
Start and Stop tasks for resque workers and resque scheduler with capistrano deploy hook (without God)
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(',')
@knzai
knzai / 1_intro_to_subject.rb
Created February 8, 2011 07:45
A pattern for testing class methods in ruby with rspec explicit subjects
# 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 }
@andruby
andruby / deploy.rb
Created January 26, 2011 19:48
Start and Stop tasks for resque workers, with capistrano deploy hook (without God)
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}"
@cowboy
cowboy / HEY-YOU.md
Last active July 1, 2024 08:37
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.