Skip to content

Instantly share code, notes, and snippets.

@orenbenkiki
orenbenkiki / gist:5189329
Created March 18, 2013 18:01
Enhanced mix cover (generate index.html, and more)
defmodule Mix.Tasks.Test do
use Mix.Task
@shortdoc "Run a project's tests"
@moduledoc """
Run the tests for a project.
This task will preload the `test/test_helper.exs` which
should do all testing setup and then require all files
@mislav
mislav / test_helper.rb
Last active May 20, 2020 14:52
Vim highlight lines of Ruby that are not covered with tests. When the test suite runs, SimpleCov will generate a "coverage/raw" file. Next, the Vim function can be used to read data from that file for the current buffer and mark lines not covered with tests.
require 'simplecov'
require 'coveralls'
# writes out a "coverage/raw" file to be read by Vim
class RawMissingLinesFormatter
def format(result)
File.open('coverage/raw', 'w') { |raw|
result.source_files.each do |file|
file.lines.each do |line|
if line.missed?
@sigma
sigma / redis-mini.nix
Created April 17, 2016 06:30
minimal #redis #docker image with #nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
su_exec = pkgs.stdenv.mkDerivation {
name = "su-exec-0.2";
src = fetchurl {
url = https://github.com/ncopa/su-exec/archive/v0.2.tar.gz;
sha256 = "09ayhm4w7ahvwk6wpjimvgv8lx89qx31znkywqmypkp6rpccnjpc";