Skip to content

Instantly share code, notes, and snippets.

@yurug
yurug / ocamooc3.md
Last active January 22, 2023 05:49

Learn functional programming with the OCaml programming language

Registrations are open!

Functional programming is attracting interest from a broad range of developers because it allows to write expressive, concise and elegant programs.

The course "Introduction to Functional programming using the OCaml language" introduces gradually the central notions of functional programming, via a set of video courses that are complemented by a

@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 3, 2024 08:18
Swift Concurrency Manifesto
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)

Getting Started in Scala

This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere…  I hope to present the information you need without assuming anything.

Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!

One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.

Getting the JVM

@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active April 27, 2024 01:22
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@carymrobbins
carymrobbins / pretty-print.scala
Last active January 17, 2024 14:02
Pretty print Scala case classes and other data structures.
/**
* Pretty prints a Scala value similar to its source represention.
* Particularly useful for case classes.
* @param a - The value to pretty print.
* @param indentSize - Number of spaces for each indent.
* @param maxElementWidth - Largest element size before wrapping.
* @param depth - Initial depth to pretty print indents.
* @return
*/
private def prettyPrint(a: Any, indentSize: Int = 2, maxElementWidth: Int = 30, depth: Int = 0): String = {
@DanielaSfregola
DanielaSfregola / MyConfig.scala
Last active March 20, 2022 18:33
A simple script that will try to load configurations in the following order: 1) From properly named environment variables 2) From command line paramenters 3) From the configuration file. See article http://danielasfregola.com/2015/06/01/loading-configurations-in-scala/
import com.typesafe.config.ConfigFactory
import scala.util.Properties
class MyConfig(fileNameOption: Option[String] = None) {
val config = fileNameOption.fold(
ifEmpty = ConfigFactory.load() )(
file => ConfigFactory.load(file) )
def envOrElseConfig(name: String): String = {
@Licenser
Licenser / eqc_dot.erl
Last active August 29, 2015 14:20
eqc_dot.erl
-module(eqc_dot).
-export([example_data/0, to_dot/1, to_dot/2, find_path/2]).
-define(DATA, [{init,{{state,[],[],[],[],[],[],[],[],#{},
#{user1 => {user,user1,undefined,[]},
user2 => {user,user2,undefined,[]}},
{var,admin}},
[{blocked_calls,[]},
{fresh_id,1},
@jewelia
jewelia / gist:0b8f26e91f2818bef460
Last active August 29, 2015 14:15
3 Great Engineering Management Talks from 2014

General key themes:

  • Hiring is really hard. You’re not just hiring a “Rails Engineer” or a “Python Programmer” you’re hiring someone who can help you change the world. Tell them why! Talk about the hard problems you’re solving. 2/3 of these talks give ideas and insight into hiring from sourcing to actual interview processes.

  • Rewriting systems is hard. People think they are going to replace their broken down horse and buggie with a bullet train and this often ends up in disaster. Successful rewrites require an incremental approach that takes months/years and often runs way over schedule. 2/3 of these talks go over how to handle rewrites not only from a high level technical perspective but a cultural/management perspective as well.

Two Developers, Many Lines of Code, and A Campaign that Made History

Harper Reed (CTO of Obama for America, now CEO of Modest) and Dylan Richard (Director of Eng of Obama for America, now CTO of Modest)