Skip to content

Instantly share code, notes, and snippets.

Avatar

Elia Cereda EliaCereda

View GitHub Profile
@EliaCereda
EliaCereda / raytune-nested-test.py
Created Nov 14, 2020
WandB Ray Tune Nested Config Test Case
View raytune-nested-test.py
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 Jun 16, 2019
Convert NSImage to NumPy ndarray and viceversa
View NSImage+Python.swift
//
// 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
View RelativeDate.swift
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 / PKGBUILD
Last active Aug 29, 2015
shairport-sync-git Arch Linux package
View PKGBUILD
# 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 Dec 24, 2015
Runtime instance variables for Objective-C classes
View CRZRuntimeIvars.h
//
// 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
You can’t perform that action at this time.