Skip to content

Instantly share code, notes, and snippets.

View kamilchm's full-sized avatar

Kamil Chmielewski kamilchm

View GitHub Profile
@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active November 5, 2024 02:15
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?

@AndersonTorres
AndersonTorres / nix-development-template-file.org
Last active July 26, 2024 00:09
A project workflow for Nixpkgs/NixOS

Standard project structure

This is a project structure I’ve found useful. Looking for any thoughts/comments/feedback. Roughly, I found a tension between the style nixpkgs expects and the style conducive to development, so I extracted the common portion into a derivation.nix which is used by the remaining .nix files. This setup allows me to use nix build, nix-shell, overlays, Hydra, alternate packaging schemes, cross-compiling, etc.

Peer to Peer Cloud Computing

Current cloud services and traditional Web sites like Amazon or Azure or Google or Facebook all are centralized from the management point of view and thus, they suppose a threat as big as a Super-Mainframe would pose for privacy and security of the data as well as the computing power. Amazon could paralyze the entire world. Facebook can be perfect for political campaigns if the right "leaks" happens when they need them. we know it very well.

The source of concern are:

  • The centralized databases that consolidate all the data of all users instead of letting the user to control where to store his own data wether locally or in other's nodes and define his own access policies. Although centralized databases are also a consequence of other concerns depicted below, centralization of data is something desired, since it is very profitable for legal and -I´m worried- criminal uses of such data.

  • The methods for obtaining scalability apparently demand farms of computers, again

@posener
posener / go-shebang-story.md
Last active October 18, 2024 01:42
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

%!PS-Adobe-3.0 EPSF-3.0
%%Creator: cairo 1.14.6 (http://cairographics.org)
%%CreationDate: Thu Nov 3 14:26:49 2016
%%Pages: 1
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%BoundingBox: 189 495 415 722
%%EndComments
%%BeginProlog
save
[signup] elm-make SignupForm.elm
Some new packages are needed. Here is the upgrade plan.
Install:
elm-lang/core 4.0.1
Do you approve of this plan? (y/n) y
Downloading elm-lang/core
Packages configured successfully!
I cannot find module 'Html.App'.
#!/usr/bin/python
"""
Script to migrate marathon tasks from the host going for maintenance
optional arguments:
-h, --help show this help message and exit
--url URL Marathon URL (http://marathon.example.com)
--hosts HOSTS Hosts going to go for maintenance
@sigma
sigma / redis-mini.nix
Created April 17, 2016 06:30
minimal #redis #docker image with #nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
su_exec = pkgs.stdenv.mkDerivation {
name = "su-exec-0.2";
src = fetchurl {
url = https://github.com/ncopa/su-exec/archive/v0.2.tar.gz;
sha256 = "09ayhm4w7ahvwk6wpjimvgv8lx89qx31znkywqmypkp6rpccnjpc";
@Kornel
Kornel / recursive-cowsay.sh
Last active February 4, 2016 14:18
Recursive cowsay inception - random cow at every step
#!/usr/bin/env bash
COWS_PATH="/usr/local/share/cows"
COW_FILES=($(ls $COWS_PATH))
COWS=${#COW_FILES[@]}
rand_cow() {
#RAND_IDX=$(($RANDOM % $COWS))
RAND_IDX=$((`od -vAn -N4 -tu4 < /dev/urandom` % $COWS))
@rvl
rvl / test-docker.nix
Last active September 28, 2020 23:22
Examples of using nixpkgs PR 11156 https://github.com/NixOS/nixpkgs/pull/11156
# How to build docker images (NIX_PATH and hydra cache required when building off master branch)
# export NIX_PATH=$HOME/dev
# nix-build --option extra-binary-caches http://hydra.nixos.org/ test-docker.nix | xargs -n1 docker load -i
with import <nixpkgs> {};
rec {
# 1. basic example
bash = dockerTools.buildImage {
name = "bash";