Skip to content

Instantly share code, notes, and snippets.

View nico202's full-sized avatar

Nicolò Balzarotti nico202

View GitHub Profile
@mnacamura
mnacamura / eliminate-homebrew-dependency.nix
Last active February 12, 2018 02:46
Julia in nixpkgs: managed to handle external dependency on Darwin
#!/usr/bin/env nix-shell --pure
with import <nixpkgs> {};
let
d = version: "v${lib.concatStringsSep "." (lib.take 2 (lib.splitString "." version))}";
extraLibs = [ mbedtls zlib zeromq3 ];
in
stdenv.mkDerivation rec {
name = "julia-${version}-env";
version = julia.version;
@boris-arzur
boris-arzur / IDLE with asyncio + imaplib + mbsyncrc
Last active July 5, 2023 14:44
I use a mail stack based on mbsync & notmuch. I want to run mbsync on new mails. IDLE allows watching efficiently one folder in my mailbox. Async makes is easy to watch a few connections.
#!python3
import imaplib
import os
import asyncio
loop = asyncio.get_event_loop()
conf = [x.strip().split() for x in open('mbsyncrc')]
@exic
exic / player-control
Created December 2, 2014 12:16
Control a player implementing MPRIS D-Bus Specification v2.2
#!/bin/sh
name="$1"
shift
PATHS="org.mpris.MediaPlayer2.$name /org/mpris/MediaPlayer2"
DBUS_SEND="dbus-send --type=method_call --dest=$PATHS"
RC="$DBUS_SEND org.mpris.MediaPlayer2.Player"
if [ "$@" = "prev" ]; then
$RC.Previous
elif [ "$@" = "stop" ]; then
$RC.Pause
@DamienCassou
DamienCassou / configuration.nix
Created October 22, 2014 13:41
configuration.nix file for NixOS on my macbook pro
{ config, pkgs, ... }:
let
hostname = "luz3";
in {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# I use VirtualBox to connect to Windows and Linux guests