Skip to content

Instantly share code, notes, and snippets.

@gausby
gausby / README.org
Last active July 17, 2022 14:19
Short presentation on the benefits of using structs for process state management

Structs Our Friends

Introduction

Just to get everyone up to speed; Structs are a great because they provide compile time checks. Compile-time checks are awesome as we can catch errors before we run our application in the run-time. Structs also allow us to make custom data types, and we can implement protocols that amongst other things allow us to tell Elixir how it should enumerate over our data type, or insert items into our data type using Protocols.

@adisbladis
adisbladis / env1-shell.nix
Created July 17, 2019 11:53
Merge multilple shell.nix files using mkShell
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = [
pkgs.hello
];
shellHook = ''
echo env1
'';
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "cloudi-${version}";
version = "1.7.5";
src = fetchzip {
url = "https://osdn.net/dl/cloudi/${name}.tar.gz";
sha256 = "0aj0rwzfyad99gnm27km705ba46nsdy1ww87qgk3cfpi0017wx86";
};
#!/usr/bin/env bash
# Installs NixOS on an OVH server, wiping the server.
#
# This is for a specific server configuration; adjust where needed.
# Originally written for an OVH STOR-1 server.
#
# Prerequisites:
# * Create a LUKS key file at /root/benacofs-luks-key
# e.g. by copying it up.
@CMCDragonkai
CMCDragonkai / nix_inputs.md
Last active March 31, 2025 18:44
Understanding Nix Inputs #nix

Understanding Nix Inputs

Every Nix derivation produces a Nix store output that has 3 things:

  • Executables
  • Libraries
  • Data

Executables are always exported using the PATH environment variable. This is pretty much automatic.

@neonphog
neonphog / nix-n3h.bash
Last active May 1, 2019 17:36
nix-n3h.bash
#!/bin/bash
# -- sane bash errors -- #
set -Eeuo pipefail
# -- docker exec -- #
cat > Dockerfile <<EOF
FROM nixos/nix
RUN nix-channel --add https://github.com/Holo-Host/nixpkgs-channels/archive/680f9d7ea90dd0b48b51f29899c3110196b0e913.tar.gz
@aabs
aabs / shell.nix
Last active July 10, 2022 05:24
A simple nix-shell script to establish an environment for Phoenix, Elixir and PostgreSQL development
{ nixpkgs ? import <nixpkgs> {}
, version ? "0.1"
, proxy ? "http://10.183.23.58:3128"
}:
with nixpkgs;
let
elixir = beam.packages.erlangR21.elixir_1_7;
nodejs = nodejs-10_x;
@abhioncbr
abhioncbr / Apache_Superset.md
Last active September 2, 2024 09:11
Apache Superset in the production environment

Apache Superset in the production environment

Visualising data helps in building a much deeper understanding of the data and fastens analytics around the data. There are several mature paid products available in the market. Recently, I explored an open-source product name Apache-Superset which I found a very upbeat product in this space. Some prominent features of Superset are:

  • A rich set of data visualisations
  • An easy-to-use interface for exploring and visualising data
  • Create and share dashboards

After reading about Superset, I wanted to try it, and as Superset is a python programming language based project, we can easily install it using pip, but I decided to set it up as a container based on Docker. Apache-Superset GitHub Repo contains code for building and running Superset as a container. Since I wan

@metametadata
metametadata / helpers.clj
Created November 14, 2018 12:21
Faster PostgreSQL upsert in HoneySQL and funcool/clojure.jdbc
(ns app.jdbc.helpers
(:require [jdbc.core :as jdbc]
[jdbc.proto :as jdbc-proto]
[honeysql.core :as sql]
; Load extensions
[honeysql-postgres.format]))
(defn -upsert-sql
[table keys pk]

Getting Started With Superset: Airbnb’s data exploration platform

These instructions are for Amazon Linux Version 2

Update Python and PIP versions on EC2 (Amazon AMI)

sudo yum update -y
sudo yum install python3 -y