Skip to content

Instantly share code, notes, and snippets.

View sentenza's full-sized avatar

Alfredo Torre sentenza

View GitHub Profile
#!/usr/bin/python3
def mapReduceTR(f, combine, zero, a, b):
def loop(a, acc):
if (a > b):
return acc
else:
return loop(a + 1, combine(f(a), acc))
return loop(a, zero)

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

@sentenza
sentenza / .gitignore
Created October 15, 2015 12:48
Symfony2 .gitignore
# Cache and logs (Symfony2)
/app/cache/*
/app/logs/*
!app/cache/.gitkeep
!app/logs/.gitkeep
# Cache and logs (Symfony3)
/var/cache/*
/var/logs/*
!var/cache/.gitkeep
@sentenza
sentenza / local.conf
Created January 20, 2016 09:17
Debian Fontconfig -> see: http://guide.debianizzati.org/index.php/Migliorare_l%27aspetto_dei_font FIle: /etc/fonts/local.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<!-- La rasterizzazione dei caratteri converte i dati vettoriali dei font
in immagini bitmap, così da poter essere visualizzati sullo schermo.
Il risultato può apparire frastagliato per via dell'aliasing.
L'anti-aliasing aumenta il dettaglio visivo dei bordi dei caratteri. -->
<edit mode="append" name="antialias">
@sentenza
sentenza / arch-linux-install
Created January 23, 2016 23:23 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap

Changelog

Public releases are all root nodes.
Incremental version bumps that were not released publicly are nested where appropriate.

P.S. If there is a standard (popular) changelog format, please let me know.

@sentenza
sentenza / First-steps.md
Last active February 7, 2016 11:26
Angular 2 - Useful resources
@sentenza
sentenza / find_easter_sunday.sql
Last active November 10, 2021 15:00
Calculate date of easter based on Year passed. Based on Anonymous Gregorian Algorithm, also known as the Meeus/Jones/Butcher algorithm: https://en.wikipedia.org/wiki/Computus#Gauss_algorithm
CREATE OR REPLACE FUNCTION anonymous_easter(xyear integer) RETURNS date AS $$
DECLARE
a int;
b int;
c int;
d int;
e int;
f int;
g int;
@sentenza
sentenza / ScalaTools.md
Last active October 22, 2016 08:12 — forked from pathikrit/README.md
My highly opinionated list of things needed to build an app in Scala
@sentenza
sentenza / 00_Symfony_DoctrineExtensions_Translation.md
Last active January 22, 2017 10:01
Symfony and StofDoctrineExtensionsBundle - Gedmo Translatable

How to translate with Symfony in the safest way

  1. Follow the installation guide reported here: https://symfony.com/doc/master/bundles/StofDoctrineExtensionsBundle/index.html
  2. Further information about the installation of the base library (Gedmo) https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/symfony2.md
  3. Configuring the Translatable extension: https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/translatable.md

And then you need to configure per bundle extension adding the neeeded schema on database as reported in create_ext_translations_postgres.sql.

Enabling Gedmo per mapping inside config.yml