Skip to content

Instantly share code, notes, and snippets.

@mfirry
mfirry / database.js
Created September 7, 2015 13:11
first-steps-with-relay-graphql
export class Ticket extends Object {}
var tickets = [];
(function() {
var t1 = new Ticket();
t1.id = '1';
t1.from = 'CTA';
t1.via = 'FCO';
t1.to = 'JFK';
t1.airports = ['CTA', 'FCO', 'JFK'];
@mfirry
mfirry / BigDecimalGroup.scala
Created October 19, 2016 09:59
cats-like implementation of CommutativeGroup for BigDecimal
class BigDecimalGroup extends CommutativeGroup[BigDecimal] {
def combine(x: BigDecimal, y: BigDecimal): BigDecimal = x + y
def empty: BigDecimal = 0
def inverse(x: BigDecimal): BigDecimal = -x
override def remove(x: BigDecimal, y: BigDecimal): BigDecimal = x - y
}
implicit val catsKernelStdGroupForBigDecimal: CommutativeGroup[BigDecimal] = new BigDecimalGroup
export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib

Keybase proof

I hereby claim:

  • I am mfirry on github.
  • I am mfirry (https://keybase.io/mfirry) on keybase.
  • I have a public key whose fingerprint is 139A FAEB 86CD E9C0 E126 68E3 CDFE 8735 DB12 85EA

To claim this, I am signing this object:

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import print_function, absolute_import, unicode_literals, division
with open ("input.txt") as f:
xs = f.read().strip().split("\n")
vals = [int(x) for x in xs]
vals |> sum |> print