Skip to content

Instantly share code, notes, and snippets.

View mikhailov's full-sized avatar

Anatoly Mikhaylov mikhailov

View GitHub Profile
@jgrahamc
jgrahamc / quic-cleanup.pl
Created February 17, 2014 15:27
Script to take the files generated by wget -mkp --save-headers and remove headers that confuse quic_server and at the X-Original-Url header.
# quic-cleanup.pl
#
# When running the Google experimental quic_server it expects to find
# sites to serve in /tmp/quic-data. Under that there will be a
# directory per site.
#
# For example this was used to mirror the CloudFlare web site for
# QUIC testing.
#
# mkd
@p0deje
p0deje / Vagrantfile
Last active August 29, 2015 13:57
Vagrantfile to develop and test Vagrant for Linux using DigitalOcean
# I'm running OS X and I need to develop and test Vagrant features
# which are specific to Linux-only, i.e. I need "physical" Linux machine.
# I've finally stuck with creating DigitalOcean VM and installing
# everything necessary for development there. It's magical
# Vagrant-powered Vagrant-development Vagrantfile.
#
# First, start the VM which will be the host:
# $ vagrant up host --provider=digital_ocean
#
# Now, you can start VM in VM which will be used for Vagrant testing:
@mokevnin
mokevnin / routes.erl
Created December 23, 2013 18:49
naming routes for cowboy
-module(routes).
-export([compile/0, generate_path/2, generate_url/3]).
compile() ->
List = [root, games, game, start_game],
cowboy_router:compile([
%% {URIHost, list({URIPath, Handler, Opts})}
{'_', [route(Name) || Name <- List]}
]).
@kirs
kirs / gist:8180501
Last active January 1, 2016 17:59
ruby noname podcast: конкурс

Конкурс на лучший вклад в Open Source от Ruby Noname подкаста

Задача — за новогодние праздники сделать максимально полезный PR в какой-либо известный проект на Гитхабе (например, закрыть известный баг или реализовать долгожданную фичу).

Принимаются пулреквесты на любые проекты, примеры проектов перечислены ниже. Победитель получит возможность бесплатно посетить мастер-класс по разработке на Rails Brainwashing c 18 по 21 января.

Конкурс продлится с момента выхода подкаста до 12 января. Мы опубликуем результаты на следующий день, 13 января.

Работы принимаются в комментариях к этому гисту.

@dhh
dhh / redmine_timelog_controller_create.rb
Last active May 13, 2016 13:36
Partial refactoring of https://github.com/redmine/redmine/blob/master/app/controllers/timelog_controller.rb#L104. That whole controller would need a serious amount of work to be whipped into shape, but this is a start.
class TimeEntriesController < ApplicationController
before_action :set_project, :set_issue
def create
@time_entry = container.time_entries.build time_entry_params.merge(user: User.current)
if @time_entry.save
respond_to do |format|
format.html { redirect_back_or_default created_time_entry_url, notice: l(:notice_successful_create) }
format.api { render :show, status: :created, location: @time_entry }
require "net/https"
require "uri"
require 'json'
uri = URI.parse("https://www.howsmyssl.com/a/check")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
resp = JSON.parse(http.request(Net::HTTP::Get.new(uri.request_uri)).body)
puts JSON.pretty_generate(resp)
David Heinemeier
Gihub:
• 14 repos related to Ruby
• multiple comments in rails/rails
RubyGem
• 23 Gems
• 227,964,383 downloads
Vimeo
• Uploaded RubyConf video
37Signals
@irabinovitch
irabinovitch / monitorama2018.md
Last active June 3, 2019 13:50
Monitorama 2018 Talks
@hostmaster
hostmaster / nginx.conf
Created March 7, 2012 11:19
nginx post-action
location ^~ /attachments/download_zip/ {
proxy_pass http://mongrel;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X_Forwarded_Proto $scheme;
proxy_read_timeout 120;
proxy_connect_timeout 120;
post_action @notify_zip
# MODEL
class Case < ActiveRecord::Base
include Eventable
has_many :tasks
concerning :Assignment do
def assign_to(new_owner:, details:)
transaction do