Skip to content

Instantly share code, notes, and snippets.

@dtoma
dtoma / invoker.md
Last active July 3, 2019 06:35
Invoker Poster
  • Allow to filter by build (Q/W, Q/E...)
  • Centerer horizontally & vertically
  • Responsive (svg icons anywhere?)

Represent as a matrix?

QWE
---
.
@dtoma
dtoma / ec.md
Last active June 5, 2019 10:21
Enterprise code

Incremental improvements

Clean repos

  • Clean up unused branches
  • Merge remaining branches incrementally

Checkout/build default to green

Ensure all repos can be cloned & built. Can be as simple as a cron job running a script like:

@dtoma
dtoma / plot.py
Created May 31, 2019 10:23
Center a plot on y=0
data = pd.Series(...)
highest_point = abs(data.max())
lowest_point = abs(data.min())
max_y = max(highest_point, lowest_point)
# Expand to the nearest order of magnitude (throws if max_y==0)
max_y *= 10**int(math.log10(max_y))
data.plot(ylim=(-max_y, max_y))
@dtoma
dtoma / haskelltil.md
Last active May 1, 2019 09:14
Haskell TIL

2019-04-12

  1. trace:

This will print p1 and p2 then return ()

Prelude Debug.Trace> myFunc p1 p2 = traceShow (p1, p2) ()
Prelude Debug.Trace> myFunc 1 2
(1,2)
@dtoma
dtoma / impots.hs
Created April 11, 2019 05:38
impots
tranche :: Int -> Int -> Float -> Int -> Float
tranche min max taux revenu = if revenu > max then (max - min) * taux else (revenu - min) * taux
tranches :: [Int]
tranches = [0, 9807, 27086, 72617, 153783]
rates :: [Float]
rates = [0.0, 0.14, 0.30, 0.41, 0.45]
-- Jusqu'à 9 807 euros 0 %
@dtoma
dtoma / typeclasses.md
Created March 26, 2019 08:36
Typeclasses notes

We can use an Applicative all the way:

Prelude> pure (*) <*> (Just 2) <*> (Just 3)
Just 6

But we can also use a Functor and then Applicative for the rest of the computation:

Prelude&gt; (*) &lt;$&gt; (Just 2) &lt;*&gt; (Just 3)
@dtoma
dtoma / microservices.md
Created February 15, 2019 08:44
Problems with microservices

Problems with microservices

Dependencies

We have Projects A, B, and C. We have Team 1 and Team 2.

  • Project A (Team 1) depends on a library, version==1.1.0
  • Project B (Team 2) dependes on the same library, 1.0.0 < version < v1.2.0.
  • Project C (Team 2) depends on the same library, 1.0.0 < version < v1.2.0.
  • Project A depends on Project C. One day, Team 2 updates projects B and C's dependencies, making their version requirements version==1.3.0, in order to benefit from a bug fix.
@dtoma
dtoma / djtest.md
Last active February 14, 2019 08:38
Django testing problems
@dtoma
dtoma / delta.md
Created January 18, 2019 07:38
Δ - delta, delta hedging

source source source

Delta

The delta is a ratio comparing the change in the price of an asset, usually a marketable security, to the corresponding change in the price of its derivative. For example, if a stock option has a delta value of 0.65, this means that if the underlying stock increases in price by $1 per share, the option on it will rise by $0.65 per share, all else being equal.

Delta values can be positive or negative depending on the type of option. For example, the delta for a call option always ranges from 0 to 1 because as the underlying asset increases in price, call options increase in price. Put option deltas always range from -1 to 0 because as the underlying security increases, the value of put options decrease. For example, if a put option has a delta of -0.33, if the price of the underlying asset increases by $1, the price