Skip to content

Instantly share code, notes, and snippets.

@darccio
darccio / dhondt.go
Created January 14, 2019 23:45
D'Hondt method
package electoral
import (
"sort"
)
// CandidatureResult is all the votes tallied for a candidature.
type CandidatureResult struct {
Name string
Votes int
@mathewbyrne
mathewbyrne / CsvResponse.php
Created March 21, 2013 22:54
A small Symfony 2 class for returning a response as a CSV file. Based on the Symfony JsonResponse class.
<?php
namespace Jb\AdminBundle\Http;
use Symfony\Component\HttpFoundation\Response;
class CsvResponse extends Response
{
protected $data;