Skip to content

Instantly share code, notes, and snippets.

View hauleth's full-sized avatar
⌨️
Click! Clack!

Łukasz Jan Niemier hauleth

⌨️
Click! Clack!
View GitHub Profile
## Build
build:
stage: build
tags:
- elixir
script:
- eval $(ssh-agent -s)
- echo "$SSH_BUILD_KEY" | tr -d '\r' | ssh-add -
- git branch -f master HEAD
- mix edeliver build release --revision="$CI_BUILD_REF" --auto-version=revision
defmodule Advent1 do
def sum([h|_]=list),do: do_sum(list++[h],0)
defp do_sum([_],sum),do: sum
defp do_sum([a|[a|_]=rest],sum),do: do_sum(rest,sum+a-?0)
defp do_sum([_|rest],sum),do: do_sum(rest,sum)
end
IO.puts Advent1.sum to_charlist IO.read :all
[
{
"backcolor": "#b0b0b0",
"name": "SA MCRN Donnager",
"author": "Łukasz Niemier"
},
[
{
"c": "#e3e2dd",
"t": "#2d3238",
@hauleth
hauleth / fix-fmt.sh
Last active November 10, 2017 12:21
#!/bin/sh
set -eo pipefail
in="$(mktemp)"
out="$(mktemp)"
trap "rm '$in' '$out'" EXIT
cat /dev/stdin > "$in"
"$@" < "$in" 2>/dev/null > "$out" && cat "$out" || cat "$in"
@hauleth
hauleth / sudo_lecture
Created October 14, 2017 19:05
Sudo lecture
 ╓▄≡≡▄╖
 ╓▀ ⸜⏋⎾⸝ ▀╖
 ,▓⸜▚▃`´▃▞⸝▓,
 █  `⸜▀▀⸝´  █
 . ▓▐  ∕≡≡∖  ▌▓ .
 #⌉'╯ ║▌  ∣≡≡∣  ▐║ ╰'⌠#
 ¬"  ▐V  ▀▄_∕≡≡∖_▄▀ V▌ "⌐
 w╜ ▐▄ ,:« "▀▀▀▀" »:, ▄▌ ╙w
 ▐╖▄▄▄▄²▌^ ▐ ▌ ^▌²▄▄▄▄╓▌
 ▐╡W▐║ ▐  / ,, \  ▐ ║▌W╞▌
### Keybase proof
I hereby claim:
* I am hauleth on github.
* I am hauleth (https://keybase.io/hauleth) on keybase.
* I have a public key ASC0dZl_5-9qDXYdx41ee4Hg-qPbyRBmapJevdcVdwy5Rwo
To claim this, I am signing this object:
extern crate rayon;
extern crate regex;
extern crate scan_dir;
use rayon::prelude::*;
use regex::Regex;
use scan_dir::ScanDir;
use std::env;
use std::fs::File;
@hauleth
hauleth / .rubocop.yml
Last active January 27, 2016 10:22
Hauleth's template
AllCops:
Exclude:
- bin/*
- config/**/*
- coverage/**/*
- db/**/*
- doc/**/*
- log/**/*
- public/**/*
- script/**/*
@hauleth
hauleth / test.json
Last active December 29, 2015 04:19
{
"machines": [
{
"maintenances": [
{ "start": 10, "duration": 10 },
{ "start": 50, "duration": 10 },
]
}
],
"tasks": [
@hauleth
hauleth / Gemfile
Last active December 19, 2015 04:09 — forked from amscotti/mongo_urlshortener.rb
Simple Sinatra + Mongoid URL shortener (untested)
source 'https://rubygems.org'
gem 'sinatra'
gem 'slim'
gem 'mongoid'
gem 'bson_ext'