Skip to content

Instantly share code, notes, and snippets.

View ArturT's full-sized avatar

Artur Trzop ArturT

View GitHub Profile
@mfittko
mfittko / knapsack-with-working-coverage.rb
Last active August 3, 2020 09:07
In order to have full working coverage (includign lib folder) we needed to make sure to start simplecov coverage reporting befor the knapsack rspec task was invoked...
#!/usr/bin/env ruby
require_relative '../../spec/support/simple_cov_helper.rb'
SimpleCovHelper.report_coverage('integration')
load "#{Gem::Specification.find_by_name('knapsack_pro').gem_dir}/lib/tasks/queue/rspec.rake"
Rake::Task['knapsack_pro:queue:rspec'].invoke('--format doc --format RSpec::Instafail --tag ~skip --format RspecJunitFormatter --out tmp/test_results/spec/integration.xml')
@olgaczarnecka
olgaczarnecka / Unix Philosophy - rules
Last active March 22, 2020 15:01
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.
@bradtraversy
bradtraversy / eslint_prettier_airbnb.md
Created July 19, 2019 17:54
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
@rafaltrzop
rafaltrzop / prepare-commit-msg
Last active October 17, 2018 12:51
Git prepare-commit-msg hook adding JIRA issue key before git commit message based on your branch name e.g. feature/KEY-1234
#!/bin/sh
###############################################################################
# Setup #
###############################################################################
# Use global hooks directory for each existing and new repository:
# $ git config --global core.hooksPath '~/.git-hooks'
# $ mkdir ~/.git-hooks
# $ chmod a+x ~/.git-hooks/prepare-commit-msg
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 4, 2024 05:06
set -e, -u, -o, -x pipefail explanation
@cscalfani
cscalfani / ThinkAboutMonads.md
Last active December 4, 2022 20:58
How to think about monads

How to think about Monads

UPDATE 2021: I wrote this long before I wrote my book Functional Programming Made Easier: A Step-by-step Guide. For a much more in depth discussion on Monads see Chapter 18.

Initially, Monads are the biggest, scariest thing about Functional Programming and especially Haskell. I've used monads for quite some time now, but I didn't have a very good model for what they really are. I read Philip Wadler's paper Monads for functional programming and I still didnt quite see the pattern.

It wasn't until I read the blog post You Could Have Invented Monads! (And Maybe You Already Have.) that I started to see things more clearly.

This is a distillation of those works and most likely an oversimplification in an attempt to make things easier to understand. Nuance can come later. What we need when first le

@manuelpuyol
manuelpuyol / knapsack_data.rb
Created May 28, 2018 16:30
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',
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@klaaspieter
klaaspieter / ASS.md
Created June 22, 2017 07:59 — forked from anonymous/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

Knapsack Pro Queue Mode Capybara Screenshot Bug Test

Recreates the Capybara Screenshot bug.

Note: this can be fixed by switching to mattheworiordan/capybara-screenshot#205

-gem 'capybara-screenshot'
+gem 'capybara-screenshot', git: 'https://github.com/ArturT/capybara-screenshot.git',
+                           branch: 'fix-reporter_module-loaded-twice'