Skip to content

Instantly share code, notes, and snippets.

View psilospore's full-sized avatar
🍄

psilospore psilospore

🍄
View GitHub Profile
@graninas
graninas / haskeller_competency_matrix.md
Last active June 30, 2024 10:13
Haskeller competency matrix
@hrhino
hrhino / Debug.scala
Created November 4, 2019 21:49
commands for enabling / disabling java debugger in scala/scala
package scala.build
import sbt._, Keys._, plugins._
object Debug extends AutoPlugin {
override def requires = JvmPlugin
override def trigger = allRequirements
import VersionUtil._
@janhicken
janhicken / CloudFunctions.scala
Last active March 27, 2020 15:45
Google Cloud Functions with Scala.js
package de.janhicken.cfwithscala
import scala.scalajs.js.annotation.JSExportTopLevel
object CloudFunctions {
@JSExportTopLevel("helloWorld")
val helloWorld: CloudFunction = (request, response) ⇒ {
response.status(200).send("Hello World!")
}
}
@claudinei-daitx
claudinei-daitx / SparkSessionS3.scala
Created December 15, 2017 13:02
Create a Spark session optimized to work with Amazon S3.
import org.apache.spark.sql.SparkSession
object SparkSessionS3 {
//create a spark session with optimizations to work with Amazon S3.
def getSparkSession: SparkSession = {
val spark = SparkSession
.builder
.appName("my spark application name")
.config("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
.config("spark.hadoop.fs.s3a.access.key", "my access key")
@VictorTaelin
VictorTaelin / promise_monad.md
Last active May 10, 2024 04:22
async/await is just the do-notation of the Promise monad

async/await is just the do-notation of the Promise monad

CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.

In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.

First, let's illustrate the 3 styles by implementing

@retronym
retronym / doc.md
Last active September 21, 2018 20:55
Scripts for convenient access to Scala pre-release builds
@smarter
smarter / gadt.md
Last active March 6, 2024 23:33
GADTs in Scala

Generalized Algebraic Data Types in Scala

Basic GADTs

Here's an ADT which is not a GADT, in Haskell:

data Expr = IntExpr Int | BoolExpr Bool
@subfuzion
subfuzion / global-gitignore.md
Last active July 16, 2024 18:54
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 30, 2024 04:14
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@sigrlami
sigrlami / ab.md
Last active March 4, 2022 14:40
List of companies using Haskell https://haskellcosm.com

WARNING This list outdated, for the up to date version visit https://haskellcosm.com

List of companies that use Haskell in Production

Types of work:

  • RD - research&development
  • PR - product
  • IP - in-house product
  • CO - consulting