Skip to content

Instantly share code, notes, and snippets.

View EliaCereda's full-sized avatar

Elia Cereda EliaCereda

  • Lugano, Switzerland
View GitHub Profile
@EliaCereda
EliaCereda / PKGBUILD
Last active August 29, 2015 14:13
shairport-sync-git Arch Linux package
# Maintainer: Elia Cereda <eliacereda+arch at gmail dot com>
pkgname=shairport-sync-git
pkgver=2.1.15.r1.gcf6594d
pkgrel=1
pkgdesc='Emulates an AirPort Express for the purpose of streaming music from iTunes and compatible iPods and iPhones'
url='https://github.com/mikebrady/shairport-sync'
arch=(i686 x86_64 armv6h armv7h)
license=('custom')
backup=(etc/conf.d/shairport-sync)
@EliaCereda
EliaCereda / CRZRuntimeIvars.h
Last active December 24, 2015 00:19
Runtime instance variables for Objective-C classes
//
// CRZRuntimeIvars.h
// CRZRuntimeIvars
//
// Copyright (c) 2013-2015 Elia Cereda
//
// 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
func relativeDateString(date: NSDate) -> String {
let components: Array<(Int, (Int) -> String)> = [
(60 * 60 * 24 * 365, { x in "\(x) anni fa" }),
(60 * 60 * 24 * 30, { x in "\(x) mesi fa" }),
(60 * 60 * 24 , { x in "\(x) giorni fa" }),
(60 * 60 , { x in "\(x) ore fa" }),
(60 , { x in "\(x) minuti fa" })
]
@EliaCereda
EliaCereda / raytune-nested-test.py
Created November 14, 2020 12:22
WandB Ray Tune Nested Config Test Case
import wandb
from wandb.sweeps.config import tune
from wandb.sweeps.config.tune.suggest.hyperopt import HyperOptSearch
from wandb.sweeps.config.hyperopt import hp
tune_config = tune.run(
'example.py',
search_alg=HyperOptSearch(
hp.choice('classifier_type', [
{
@EliaCereda
EliaCereda / NSImage+Python.swift
Created June 16, 2019 12:37
Convert NSImage to NumPy ndarray and viceversa
//
// NSImage+Python.swift
//
// Created by Elia Cereda on 03/06/2019.
// Copyright © 2019 Elia Cereda.
//
// 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