Skip to content

Instantly share code, notes, and snippets.

View datakurre's full-sized avatar

Asko Soukka datakurre

View GitHub Profile
@datakurre
datakurre / README.rst
Last active December 4, 2015 07:21
Plone 5.0 for Nix
@datakurre
datakurre / compose.py
Last active September 6, 2015 23:09
Chameleon Composer
#! /usr/bin/env nix-shell
#! nix-shell -i python -p pythonPackages.chameleon pythonPackages.docopt pythonPackages.watchdog
"""Chameleon Composer
Copyright (c) 2015 Asko Soukka <asko.soukka@iki.fi>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@datakurre
datakurre / example.robot
Last active February 27, 2023 06:50
Setting custom user agent for Firefox with RobotFramework and Selenium2Library
*** Settings ***
Library Selenium2Library
*** Test Cases ***
Open desktop version
Open browser https://www.arstechnica.com/
Open mobile version
@datakurre
datakurre / rabbitmq.nix
Last active January 4, 2016 12:22
Nix shell for RabbitMQ under $PWD with metronome plugin
with import <nixpkgs> {};
let dependencies = rec {
_rabbitmq_plugins = stdenv.mkDerivation rec {
name = "rabbitmq-plugins-${version}";
version = rabbitmq_server.version;
buildInputs = [ git python libxslt mercurial erlangR16 zip unzip ];
unpackPhase = "";
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
git clone https://github.com/rabbitmq/rabbitmq-public-umbrella
@datakurre
datakurre / app.py
Last active July 24, 2017 20:12
Python package development shell example in Nix
from latex import build_pdf
min_latex = (r"\documentclass{article}"
r"\begin{document}"
r"Hello, world!"
r"\end{document}")
# this builds a pdf-file inside a temporary directory
pdf = build_pdf(min_latex)
@datakurre
datakurre / connection.py
Last active September 22, 2023 11:13
Python 3.5 async / await example with HTTP-AMQP -bridge and Nix based development environment
# -*- coding: utf-8 -*-
import aioamqp
connection = None
protocol = None
async def disconnected(exception):
global connection, protocol
@datakurre
datakurre / default.nix
Last active October 29, 2015 11:38
Buildable Python development environment shell in Nix
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "env";
# Mandatory boilerplate for buildable env
env = buildEnv { name = name; paths = buildInputs; };
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup; ln -s $env $out
'';
# Customizable development requirements
buildInputs = [
@datakurre
datakurre / .gitignore
Last active December 9, 2023 01:41
Multi-kernel Jupyter notebook environment and Docker container with Nix
*.ipynb
*.png
*.tar.gz
.ipynb_checkpoints
.ipython
.jupyter
.sentinel.*
@datakurre
datakurre / .gitignore
Last active August 20, 2021 11:48
R-kernel Jupyter notebook environment and Docker container with Nix
*.ipynb
*.png
*.tar.gz
.ipynb_checkpoints
.jupyter
.sentinel.*
@datakurre
datakurre / .gitignore
Last active December 29, 2022 10:29
Minimal Nix Docker
*.tar.gz
.sentinel.*