Skip to content

Instantly share code, notes, and snippets.

🎱
Testing in production

Marco Sampellegrini alpacaaa

🎱
Testing in production
Block or report user

Report or block alpacaaa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alpacaaa
alpacaaa / Cart.hs
Last active May 1, 2019
How purity in Haskell makes your life easier
View Cart.hs
module Cart where
-- An Item is just a record (like an object in JS).
data Item
= Item
{ name :: String
, quantity :: Int
}
@alpacaaa
alpacaaa / kafka-docs.pdf
Last active Sep 22, 2018
Kafka docs in pdf like it's 1995
View kafka-docs.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alpacaaa
alpacaaa / Explanation.md
Last active Aug 3, 2019
Hard things about ports being Tasks in Elm
View Explanation.md

evancz Mar 23, 2017 00:43
Just so folks are aware, one of the hard things about having ports just be a Task is the following. Right now, a Task is guaranteed to terminate with an error or a result. The only way it could be otherwise is if you have something of type Task Never Never Now, if you are calling out to random JS that is written by anyone, that guarantee goes away. You have to call some callback to give the value back to Elm, but what if that is never called? Maybe there's an error, maybe there is a weird code path. Now Elm code can "leak" tasks that never get completed because of problems in JS code. One way to protect against this is to have timeouts, such that there is some guaranteed end. My point here is just that it is more complicated than "what if it was a task?" and then everything would be nice.

View Advanced-FP-with-Scala.md

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
View why-and-when-to-elm.md

The Why and When of Choosing Elm

What is Elm?

  • Language (and "framework") for building web frontend applications
  • Can be used in place of HTML, CSS and JavaScript
  • Compiles into the above
View Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming Workshop.md

The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming Workshop for All!

John A. De Goes — @jdegoes


Agenda

  • Functions
  • Types, Kinds, & More Functions
  • FP Toolbox
View index.js
import React from 'react';
import { render } from 'react-dom';
import yup from 'yup';
import Form from 'react-formal';
const schema = yup.object({
test: yup.string()
});
@alpacaaa
alpacaaa / README.md
Created Dec 10, 2014
Beatport downloader
View README.md

Isn't it crazy

That motherfucking Beatport doesn't let you download tracks in bulk? Why Beatport WHY?

@alpacaaa
alpacaaa / INSTALL.md
Created Oct 14, 2013
Installing Ghost Blogging platform
View INSTALL.md

Installing Ghost is much more complicated than it is described in the docs. Here are a few additional steps needed do get it up and running.

####Clone the git repository I cannot get to work any of the random releases files I've downloaded, so start off with a fresh repo and follow the few steps that the guide actually provides.

git clone https://github.com/TryGhost/Ghost.git ghost
cd ghost
npm install
npm start
@alpacaaa
alpacaaa / nearestGitFolder.js
Last active Dec 16, 2015
Bash script to switch directory to the nearest .git folder
View nearestGitFolder.js
// .bash_aliases
// alias cdg='cd `node /path/to/script/nearestGitFolder.js`'
var fs = require('fs');
var hasGitDir = function(path) {
return fs.existsSync(path + '/.git');
}
You can’t perform that action at this time.