Skip to content

Instantly share code, notes, and snippets.

View ArturT's full-sized avatar

Artur Trzop ArturT

View GitHub Profile
@ArturT
ArturT / Equity.md
Created May 14, 2020 17:07 — forked from isaacsanders/Equity.md
Joel Spolsky on Equity for Startups

This is a post by Joel Spolsky. The original post is linked at the bottom.

This is such a common question here and elsewhere that I will attempt to write the world's most canonical answer to this question. Hopefully in the future when someone on answers.onstartups asks how to split up the ownership of their new company, you can simply point to this answer.

The most important principle: Fairness, and the perception of fairness, is much more valuable than owning a large stake. Almost everything that can go wrong in a startup will go wrong, and one of the biggest things that can go wrong is huge, angry, shouting matches between the founders as to who worked harder, who owns more, whose idea was it anyway, etc. That is why I would always rather split a new company 50-50 with a friend than insist on owning 60% because "it was my idea," or because "I was more experienced" or anything else. Why? Because if I split the company 60-40, the company is going to fail when we argue ourselves to death. And if you ju

@ArturT
ArturT / Unix Philosophy - rules
Created March 22, 2020 15:01 — forked from olgaczarnecka/Unix Philosophy - rules
Some notes regarding Unix Philosophy (actually in my opinion they apply to general good programming practices) based on "The Art of Unix Programming by Eric Steven Raymond" (http://www.catb.org/esr/writings/taoup/html/graphics/taoup.pdf)
Basics of Unix philosophy:
- Use simple algorithms as well as simple data structures
- Data structures, not algorithms are central to programming - organise it well
- Fancy algorithms are buggier than simple ones
Rules:
Modularity - build out simple parts connected by well defined interfaces. Be able to update/upgrade the part without breaking the whole.
@ArturT
ArturT / knapsack_data.rb
Created February 8, 2019 19:21 — forked from manuelpuyol/knapsack_data.rb
This is a simple script used calculate average spec files running time across multiple builds using Knapsack API. It requires that the KNAPSACK_API_TOKEN variable is set. It runs by default for the last 10 builds, but you can customize it passing the number of builds you want as an argument. Lastly, it returns a specs.txt file with the average t…
# frozen_string_literal: true
require 'httparty'
REQUESTED_BUILDS = ARGV[0].to_i || 10
SPEC_FILES = {}
def get(url, options = {})
headers = {
'cache-control': 'no-cache',
@ArturT
ArturT / README.md
Last active October 24, 2016 18:59 — forked from joakimk/README.md
CircleCI elixir build example

This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible.

We've been using this for months in multiple projects without any issues. Please ping be if there is any issues with this script and I'll update it.

It should be generic enough to work on any elixir app using mix.

If you have a elixir_buildpack.config, then enable that section in the build script to keep versions in sync!

Extra note

@ArturT
ArturT / prepare-commit-msg.rb
Last active October 31, 2017 15:25 — forked from marioizquierdo/git-commit-msg-jira-trello.rb
git hook prepare commit message for JIRA. It adds story id and story url in commit message.
#!/usr/bin/env ruby
#
# Git prepare-commit-msg hook for JIRA project.
#
# Name your feature brach like: my-feature-STORY_ID for instance feature-LL-123
#
# Install:
# Create a file with this content in `yourproject/.githooks/prepare-commit-msg`
# or put this file somewhere, for example `~/.githooks/prepare-commit-msg`, and symlink it:
#
#!/bin/bash
i=0
files=()
# sort spec files by number of examples for better balancing
for file in $(find ./spec -name "*_spec.rb" -print0 | xargs -0 grep -e "^ *(it|specify)" -c | sort -t: -k2,2rn | awk -F":" '{ print $1 }')
do
if [ $(($i % $CIRCLE_NODE_TOTAL)) -eq $CIRCLE_NODE_INDEX ]
then
files+=" $file"
@ArturT
ArturT / gist:8804428
Last active August 29, 2015 13:56 — forked from jackdesert/gist:7090731
don't change non DateTime
require 'rails_admin/config/fields/base'
module RailsAdmin
module Config
module Fields
module Types
class Datetime < RailsAdmin::Config::Fields::Base
def value
value_in_default_time_zone = bindings[:object].send(name)
@ArturT
ArturT / spec_helper.rb
Last active December 23, 2015 00:58 — forked from terut/spec_helper.rb
Use different directory for carrierwave in test environment and clean up after all
RSpec.configure do |config|
# ...
config.after(:all) do
FileUtils.rm_rf(Dir["#{Rails.root}/tmp/test/carrierwave"])
end
end
CarrierWave.configure do |config|
config.root = "#{Rails.root}/tmp/test/carrierwave"