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')
@johnfedoruk
johnfedoruk / clamd-setup.md
Last active March 26, 2025 09:07
Setting up ClamAV

ClamAV Setup Notes

Context

ClamAV can be used in a few different ways. Most importantly, it provides the ability to scan files in realtime (on-access) or to scan the file system periodically.

I tried configuring ClamAV to both perform on-access virus scanning and to perform nightly full filesystem scanning. Using the on-access option did not prove to be very useful, however a scheduled full system scan seems to be of value.

Here is my story.

@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
@mrispoli24
mrispoli24 / setting-up-heroku-and-cloudflare.md
Created October 15, 2018 18:41
Setting up Heroku and Cloudflare (the right way)

Setting up Heroku and Cloudflare (the right way)

The following outlines how to setup Heroku + Cloudflare with a full SSL certificate. What this means is that communication between the browser and the Cloudflare CDN is encrypted as well as communication between Cloudflare and Heroku’s origin server. Follow these steps exactly and the setup is a breeze.

Step 1: Set up domain names in Heroku

First you want to add the root domain and the www domain to heroku. You do this by clicking into your production application, then going to settings and then scrolling down to Domains and certificates.

Here you will add <your_domain>.com and www.<your_domain>.com. This will give you two CNAME records. They will look something like <your_domain>.com.herokudns.com and www.<your_domain>.com.herokudns.com.

Step 2: Add CNAME records to Cloudfare.

@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 April 24, 2025 20: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 July 14, 2024 18:27
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 [email protected]
brew unlink [email protected]
brew link postgresql