Skip to content

Instantly share code, notes, and snippets.

View axyz's full-sized avatar

Andrea Moretti axyz

  • Zalando SE
  • Berlin
View GitHub Profile

Keybase proof

I hereby claim:

  • I am axyz on github.
  • I am axyz (https://keybase.io/axyz) on keybase.
  • I have a public key whose fingerprint is 0935 5137 AEE7 0827 CA2B 7921 C901 15A7 55A5 ADD8

To claim this, I am signing this object:

@axyz
axyz / SassMeister-input.scss
Created June 28, 2014 13:41
Generated by SassMeister.com.
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
$_gmd-colors: (
red: (
50: #fde0dc,
100: #f9bdbb,
200: #f69988,
@axyz
axyz / SassMeister-input.scss
Created July 2, 2014 12:46
Generated by SassMeister.com.
// ----
// Sass (v3.3.9)
// Compass (v1.0.0.alpha.20)
// ----
@import url('http://roboto-webfont.googlecode.com/svn/trunk/roboto.all.css');
$_gdm-type-styles: (
display4: (
font-family: "Roboto light",
@axyz
axyz / Andrea Moretti CV
Last active August 29, 2015 14:03
Andrea_Moretti_CV
Andrea Moretti
==============
I was Born in **1987** in **Rome** where I'm actually living. After a childhood spent on dreaming to become a scientist, I've firstly approached programming languages at 11 when I've casually found QBASIC on an old 486 laptop.
My **high school** was **"Liceo Scientifico Tullio Levi Civita"** (science and math).
Now I'm still studying **Computer Science** at **"Università La Sapienza"** in Rome. I should have already finished it, but I'm kind of a bad student. Everything I learn, I learn it by myself or working with inspiring people; but this do not help with exams. Then I've also spent **1 year** doing my **Erasmus** at **"Universidad de Las Palmas de Gran Canaria"**, this neither helps with exams, but being **able to live and work in a multicultural environment** has no price in my humble opinion.
I'm collaborating with **Eikona Photography and Digital Imaging** as a **Photographer**, **IT Specialist** and **Web Designer**
@axyz
axyz / axyz-post-gallery.php
Last active August 29, 2015 14:16
axyz-post-gallery
<?php
/*
Plugin Name: WP Post Gallery
Version: 0.1
Author: Andrea Moretti (@axyz)
Author URI: http://github.com/axyz
License: GPL2
*/
;; -*- mode: dotspacemacs -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '("~/.my-spacemacs-layers/")
@axyz
axyz / packages.el
Created July 21, 2015 21:34
React spacemacs layer
;;; packages.el --- react Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Andrea Moretti & Contributors
;;
;; Author: Andrea Moretti <axyzxp@gmail.com>
;; URL: https://github.com/axyz
;;
;; This file is not part of GNU Emacs.
;;
function _perfectRowsNumber(photos, screenWidth, screenHeight) {
const idealHeight = parseInt(screenHeight / 2, 10);
const totalWidth = photos.reduce((sum, img) => sum + img.ratio * idealHeight, 0);
return Math.round(totalWidth / screenWidth);
}
function greedyLinearPartition(seq, k) {
return seq
.sort((a, b) => b - a)
.reduce((res, el) => {
res[smallerArrayIndex(res)].push(el);
return res;
// waiting for more elegant solutions (Array.fill) to work correctly
}, new Array(k).join().split(',').map(i => []));
}
function BSTLinearPartition(seq, k) {
if (seq.length <= 1) return [seq];
if (k >= seq.length) return seq.map(el => [el]);
const limit = threshold(seq, k);
let current = 0;
return seq.reduce((res, el) => {
if (sum(res[current]) + el > limit) current++;
res[current].push(el);