Skip to content

Instantly share code, notes, and snippets.

View ignar's full-sized avatar
💭
🇨🇦🇩🇪🇺🇦 Fewer lines, thus fewer bugs

Artem Melnykov ignar

💭
🇨🇦🇩🇪🇺🇦 Fewer lines, thus fewer bugs
View GitHub Profile
require 'spec_helper'
# TODO: there are a lot of code that duplicates, move it to helpers
RSpec.describe FactoryBoy do
User = Struct.new(:name, :admin)
Building = Struct.new(:address)
before(:each) do
FactoryBoy.reset
require 'active_support/all'
class User
attr_accessor :name, :admin
def initialize(options = {}, &block)
options.each do |k,v|
self.public_send "#{k}=", v
end
@ignar
ignar / gmail-web-app.yaml
Last active March 28, 2017 15:14
gmail-web-app
apiVersion: v1
kind: Service
metadata:
name: gmail-web-app
labels:
app: gmail-web-app
spec:
ports:
- port: 3000
selector:
@ignar
ignar / mysql.yaml
Created March 28, 2017 15:14
mysql.yaml
apiVersion: v1
kind: Service
metadata:
name: gmail-web-app-mysql-service
labels:
app: gmail-web-app-mysql
spec:
ports:
- port: 3306
selector:
@ignar
ignar / mysql-pv.yaml
Created March 28, 2017 15:15
mysql-pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: mysql-pv
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteOnce
hostPath:
@ignar
ignar / bl-test-assignment.md
Last active May 8, 2017 08:32
Programming Challenge

Scenario

You like to read the articles in your feed. The problem is there are so many entries each day and only a few of the articles are really good. In order to save time, you want to implement your personal feed reader. It should be a web-application that displays the last N entries of your favorite feed. The special thing about your reader: You can provide a whitelist and a blacklist of keywords. Entries of the feed are classified as "interesting" or "boring" based on the black/white-lists. For example, if you don't like sports, your blacklist would include "sport", "tennis" and similar keywords. If you love programming, your whitelist would include "ruby", "crystal" and others. The feed on your website should highlight "interesting" entries and grey-out "boring" entries. Both white- and blacklist can be hardcoded.

Tasks

  • Create a web-application (rails 5, sinatra, hanami, ...)
@ignar
ignar / brandslisten.yaml
Last active June 23, 2017 11:16
Brandslisten API V2.1
swagger: '2.0'
info:
version: "0.4"
title: Brandslisten API
description: |
API provided by Brandslisten GmbH
host: 0.0.0.0:10010
basePath: /
@ignar
ignar / test_assignment.md
Created June 15, 2017 15:12
Brandslisten GmbH Test Assignment

Brandslisten GmbH Test Assignment

Let's assume, that got back into dark ages when developers haven't FactoryGirl gem and had to use fixtures instead.

You are first one, who understood that fixtures are not so handy as other think they are. You decide to write you own library and open source it for the world. FactoryBoy is looking like a good name.

You started from the simple class that you want to test and looks as simple as it is:

class User

attr_accessor :name, :email

@ignar
ignar / convert.sh
Created June 26, 2017 10:03
Transcode VMA into mp3
#!/bin/sh
vcodec="mp4v"
acodec="mp4a"
bitrate="1024"
arate="128"
mux="mp3"
# For Linux
#vlc="/usr/bin/vlc"
  • i can't unvote posts that i already vote on. If i like a post, i want to be able to unlike it in the future.
  • when i click on my nickname or my profile image, i expect to get to my user's overview
  • at least one line break should be possible in the feedback description. currently its not possible to insert linebreaks.
  • once i click on a star rating (in the form) i am forced to give at least one star. But it's aslso possible to rate completely without stars. So we should
    • either prevent users from being able to rate without stars
    • or provide a possibility to undo the rating descision, so i can rate without stars at any given time

i would prefer to prevent users from rating without stars. It's also kind of confusing, that the posts without stars are not getting counted in the overall posts made: Currently the page says that there are 20 feedbacks in total, but there are actually 21 (20 with stars, one post without star rating).

  • it would be nice if the feedback form is able to minimize itself again,