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
# -*- encoding: utf-8 -*- | |
Gem::Specification.new do |s| | |
s.name = 'parallel_assets_compiler' | |
s.version = '0.2.2' | |
s.platform = Gem::Platform::RUBY | |
s.author = 'Jørgen Orehøj Erichsen' | |
s.email = '[email protected]' | |
s.summary = 'Compile assets in parallel' | |
s.description = 'Compile assets in parallel to speed up deployment' |
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
class IdentificationStrategy | |
def initialize origin, priorities | |
@origin = origin | |
@priorities = [priorities].flatten | |
end | |
def branch candidates | |
case candidates.length | |
when 0 | |
zero |
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
class IdentificationStrategy | |
def initialize origin, priorities | |
@origin = origin | |
@priorities = [priorities].flatten | |
end | |
def branch candidates | |
case candidates.length | |
when 0 | |
zero |
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
Feature: Identification process | |
Background: | |
Given following EGRUL source configuration | |
| step | suspicious_threshold | identification_threshold | | |
| 1 | 0 | 90 | | |
| 2 | 65 | 90 | | |
And following attributes weights | |
| inn | kpp | ogrn | okpo | short_name | full_name | | |
| 90 | 10 | 90 | 85 | 5 | 5 | | |
And following priorities |
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
permissionProducer : Producer Permission | |
permissionProducer = | |
let permission i = case i of | |
1 -> VOTE | |
2 -> FORCE | |
_ -> NONE | |
in Check.Producer.map permission <| rangeInt 0 2 | |
userProducer : Producer User | |
userProducer = |
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
require 'set' | |
class Workflow | |
def initialize(steps_config) | |
@steps_config = steps_config | |
@current_step = 0 | |
@votes = Array.new(steps_config.size) { Set.new } | |
end | |
def approve(actor) |
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
#!/bin/sh | |
echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
read inputline | |
name="$inputline" | |
echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
read inputline | |
url="$inputline" |
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
#!/usr/bin/env ruby | |
# Copyright: https://gist.github.com/skanev/9d4bec97d5a6825eaaf6 | |
# A sneaky wrapper around Rubocop that allows you to run it only against | |
# the recent changes, as opposed to the whole project. It lets you | |
# enforce the style guide for new/modified code only, as opposed to | |
# having to restyle everything or adding cops incrementally. It relies | |
# on git to figure out which files to check. | |
# |
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
def solution(input) | |
log_sum = input.map { |i| Math.log10(i) }.sum | |
input.map { |i| (10**(log_sum - Math.log10(i))).round } | |
end |
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
def solution(input) | |
log_sum = input.map { |i| Math.log10(i) }.sum | |
input.map { |i| (10**(log_sum - Math.log10(i))).round } | |
end |
OlderNewer