Skip to content

Instantly share code, notes, and snippets.

View invasionofsmallcubes's full-sized avatar
👻
Fool Stack Developer

Emanuele Ianni invasionofsmallcubes

👻
Fool Stack Developer
View GitHub Profile
{-# LANGUAGE OverloadedStrings #-}
module Domain ( AreaRole, RoleToAreas, groupByIdentityType ) where
import Data.Function (on)
import Data.List (sortBy, groupBy)
import Data.Ord (comparing)
data AreaRole = AreaRole {
role :: String,
// goods/base.go
package goods
type base struct {
name string
price float64
exported bool
}

Keybase proof

I hereby claim:

  • I am invasionofsmallcubes on github.
  • I am eianni (https://keybase.io/eianni) on keybase.
  • I have a public key ASAh5nf99-7D7ks37JuV2kKkc_czLn77ISecmqEze2SW6wo

To claim this, I am signing this object:

@invasionofsmallcubes
invasionofsmallcubes / games-list.md
Last active January 31, 2020 22:04
Digital Board Game Night - Games List
@invasionofsmallcubes
invasionofsmallcubes / aoc_day1_ex1.clj
Last active December 3, 2019 16:52
Advent Of Code - 2019 - DAY 1 - EX 1 #adventOfCode2019
;; https://adventofcode.com/2019/day/1
(def massDatabase []) ;; get the input in the link
(defn roundDown
[num] (int (Math/floor num)))
(defn fuelRequired
[mass]
(- (roundDown (/ mass 3)) 2)
)
@invasionofsmallcubes
invasionofsmallcubes / aoc_day1_ex2.clj
Last active December 3, 2019 16:50
Advent Of Code - 2019 - DAY 1 - EX 2 #adventOfCode2019
;; https://adventofcode.com/2019/day/1
(def massDatabase []) ;; get the input in the link
(defn roundDown
[num] (int (Math/floor num)))
(defn fuelRequired
[mass]
(- (roundDown (/ mass 3)) 2)
)
@invasionofsmallcubes
invasionofsmallcubes / aoc_day2_ex1.clj
Last active December 3, 2019 16:49
Advent Of Code - 2019 - DAY 2 - EX 1 #adventOfCode2019
;; https://adventofcode.com/2019/day/2
(def intcodeProgram [])
(defn op
[step program instruction]
(let [pos1 (nth program (nth program (+ step 1)))
pos2 (nth program (nth program (+ step 2)))
resultPos (nth program (+ step 3))]
(assoc program resultPos (instruction pos1 pos2))))
@invasionofsmallcubes
invasionofsmallcubes / aoc_day2_ex2.clj
Last active December 3, 2019 16:45
Advent of Code Day 2 + Ex 2 #adventOfCode2019
;; https://adventofcode.com/2019/day/2
(def intcodeProgram []) ;; get from the exercise
(defn op
[step program instruction]
(let [pos1 (nth program (nth program (+ step 1)))
pos2 (nth program (nth program (+ step 2)))
resultPos (nth program (+ step 3))]
(assoc program resultPos (instruction pos1 pos2))))
@invasionofsmallcubes
invasionofsmallcubes / aoc_day3.clj
Last active December 23, 2019 00:29
Advent of Code Day 3 #adventOfCode2019
;; https://adventofcode.com/2019/day/3
;; EXERCISES
(ns cljbrave.core)
(defrecord Movement [direction length])
(defrecord Coordinate [x y])
@invasionofsmallcubes
invasionofsmallcubes / aoc_day4.clj
Created December 24, 2019 01:49
Advent Of Code - 2019 - DAY 4 #adventOfCode2019
(ns cljbrave.day4)
(defn digits
[n]
(loop [result (list)
n n]
(if (pos? n)
(recur (conj result (rem n 10))
(quot n 10))
result)))