I hereby claim:
- I am kukunin on github.
- I am kukunin (https://keybase.io/kukunin) on keybase.
- I have a public key ASBOPhHWzAZdYPXlRSQQD3t99sxWUJ2YcOnvIcPZNStyzwo
To claim this, I am signing this object:
require 'benchmark' | |
require 'etc' | |
Ractor.new { :warmup } if defined?(Ractor) | |
def fibonacci(n) | |
return n if (0..1).include? n | |
fibonacci(n - 1) + fibonacci(n - 2) | |
end |
require 'rails_helper' | |
RSpec.describe 'hierarchy' do | |
subject(:hierarchy) { create_hierarchy(per_level: 3, levels: 5) } | |
def create_element(type, children) | |
{ type: type, children: children } | |
end | |
# Take a pen and piece of paper |
const through = require('through2'), | |
PluginError = require('gulp-util').PluginError; | |
module.exports = function myTransformation(options) { | |
if(!options) { | |
options = {}; | |
} | |
return through.obj(function (file, enc, cb) { | |
if (file.isNull()) { |
var events = require('events'); | |
var ws = require('ws'); | |
function simulateTcpSocketFromWS(ws) { | |
var socket = {}; | |
socket.remoteAddress = ws._socket.remoteAddress; | |
socket.localPort = ws._socket.localPort; |
FROM elixir:1.5 | |
MAINTAINER Sergiy Kukunin <[email protected]> | |
RUN wget -qO- https://deb.nodesource.com/setup_8.x | bash - && \ | |
apt-get install -y nodejs | |
RUN mix local.rebar | |
RUN mix local.hex --force | |
WORKDIR /app | |
ENV MIX_ENV prod |
# We are in a folder with local git repository | |
pwd | |
# We need to create an empty repo on the server | |
# We want to checkout another branch because | |
# git prevents you from pushing to the current checked branch, which is master by default | |
ssh <user>@<host> 'mkdir repo && cd repo && git init && git checkout -b local' | |
# Add remote repo | |
git remote add server <user>@<host>:repo |
class MyGrapeAPI < Grape::API | |
helpers Pundit | |
after { verify_authorized } | |
helpers do | |
def current_user | |
nil # your authentication mechanism | |
end | |
end |
I hereby claim:
To claim this, I am signing this object:
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required.' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rom' |
- hosts: workers | |
gather_facts: no | |
pre_tasks: | |
- set_fact: sequence_number="{{ ansible_default_ipv4['macaddress'].split(':')[-1] | int('', 16) }}" | |
- set_fact: daemons_count="{{ groups['daemons'] | length }}" | |
- set_fact: daemon_i='{{ (sequence_number|int) % (daemons_count|int)}}' | |
- set_fact: daemon_host="{{ hostvars[groups['daemons'][daemon_i|int]]['ansible_eth0']['ipv4']['address'] }}" | |
- debug: var=daemon_i | |
roles: | |
- role: worker |