Skip to content

Instantly share code, notes, and snippets.

View liorgonnen's full-sized avatar

Lior Gonnen liorgonnen

View GitHub Profile
/**************************************************************************/
/*!
@file feather_nrf52840_express.h
@author hathach
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2018, Adafruit Industries (adafruit.com)
/**************************************************************************/
/*!
@file feather_nrf52840_express.h
@author hathach
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2018, Adafruit Industries (adafruit.com)
@liorgonnen
liorgonnen / feather_nrf52840_express.h
Created March 4, 2020 01:19
A modified version of the Adafruit Feather nRF52840 bootloader board file found here:
/**************************************************************************/
/*!
@file feather_nrf52840_express.h
@author hathach
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2018, Adafruit Industries (adafruit.com)
/**
* Figure the ideal distribution between groups of items given the number of items in each group a
* @param weights The ideal weight distribution between the groups
* @param groupItems How many items are available in each group
* @param maxItems The max number of items to distribute
* @return A sequence containing the number of items in each group according to the requested distribution ratios
*/
def distribute(weights: Seq[Float], groupItems: Seq[Int], maxItems: Int): Seq[Int] = {
require(weights != null, "null weights")
require(groupItems != null, "null groupItems")
package utils
import play.api.LoggerLike
/**
* Created by Lior Gonnen on 9/4/14.
*/
object LogUtils {
/**
@liorgonnen
liorgonnen / CollectionUtils.scala
Last active August 29, 2015 14:05
Filter a collection of objects by values of a specific object field
package utils
import scala.collection.generic.CanBuildFrom
import scala.collection.{SeqLike, mutable}
/**
* Created by Lior Gonnen on 8/17/14.
*/
object CollectionUtils {