Skip to content

Instantly share code, notes, and snippets.

View datakurre's full-sized avatar

Asko Soukka datakurre

View GitHub Profile
{ pkgs ? import ./nix {}
}:
with pkgs;
mkShell {
buildInputs = [
(python3.withPackages(ps: with ps; [
# Packages that need to come from nixpkgs
cryptography
@datakurre
datakurre / README.md
Last active April 7, 2022 08:24 — forked from bollwyvl/README.md
ipywidgets 8 binder
@datakurre
datakurre / registry.xml
Created July 6, 2017 15:42
Rich text tiles with templates in Plone Mosaic
<?xml version="1.0"?>
<registry xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="plone">
<records prefix="plone.app.mosaic.structure_tiles.card"
interface="plone.app.mosaic.interfaces.ITile">
<value key="default_value">&lt;div class="card-header"&gt;Header&lt;/div&gt;&lt;div class="card card-block"&gt;&lt;h3 class="card-title"&gt;TItle 1&lt;/h3&gt;&lt;p class="card-text"&gt;Content&lt;/p&gt;&lt;/div&gt;</value>
<value key="category">structure</value>
<value key="read_only">False</value>
<value key="name">card</value>
@datakurre
datakurre / cli-ext-node-composition.nix
Last active October 26, 2021 20:14
hasura-graphql-engine console-assets and cli-ext in nix
# This file has been generated by node2nix 1.9.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-14_x"}:
let
nodeEnv = import ./cli-ext-node-env.nix {
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
@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 / 02-add-entrypoints.patch
Last active May 7, 2021 19:40
another nix python packaging example
diff --git a/setup.py b/setup.py
index a15336d..307fb56 100644
--- a/setup.py
+++ b/setup.py
@@ -60,6 +60,9 @@ setuptools.setup(
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
+ entry_points={"console_scripts": [
+ "mautrix-hangouts = mautrix_hangouts.__main__:main"
@datakurre
datakurre / configuration.nix
Last active March 1, 2021 15:19
Bootable NixOS USB stick for kiosk or demo usage
{ config, lib, pkgs, ... }:
with lib;
{
imports = [
# ISO image
<nixpkgs/nixos/modules/installer/cd-dvd/iso-image.nix>
# Hardware support similar to installer Live CD
<nixpkgs/nixos/modules/profiles/all-hardware.nix>
/.cache/
/.netrc
/netrc
/result
@datakurre
datakurre / static.py
Created May 3, 2020 18:01
Recipe for customizing Plone static text portlet with various rendering conditions
# -*- coding: utf-8 -*-
from jyu.flowextensions import _
from plone.api.exc import UserNotFoundError
from plone.portlet.static.static import AddForm
from plone.portlet.static.static import Assignment
from plone.portlet.static.static import EditForm
from plone.portlet.static.static import IStaticPortlet
from plone.portlet.static.static import Renderer
from Products.CMFCore.interfaces import IContentish
from venusianconfiguration import configure
@datakurre
datakurre / SauceLabs.py
Last active April 3, 2020 13:50
Robot Framework Selenium test suite with Sauce Labs support
import re
import requests
import simplejson as json
from robot.api import logger
from robot.libraries.BuiltIn import BuiltIn
USERNAME_ACCESS_KEY = re.compile('^(http|https):\/\/([^:]+):([^@]+)@')