Skip to content

Instantly share code, notes, and snippets.

View sentenza's full-sized avatar

Alfredo Torre sentenza

View GitHub Profile
@sentenza
sentenza / solid.md
Last active October 10, 2018 09:43
Documentation and resources about Solid (SOcial LInked Data). The aim of this gist is not only to enclose all the essential concepts behind Solid, but also to try to point out its drawbacks and the possible lines of development.

Solid (derived from "SOcial LInked Data") is a proposed set of conventions and tools for building decentralized social applications based on Linked Data principles (LDP).

Solid is a set of [modular and extensible specifications][solid-specs], which build on, and extend the founding technology of the world wide web (HTTP, REST, HTML). They are 100% backwards compatible with the existing web. Each spec, taken in isolation, provides extra features to an existing system. However, when used in combination, they enable exciting new possibilities for web sites and applications.

The key principles at the base of this set of conventions - it's worth to repeat that concept to avoid any ambiguity - are basically 3:

1. True data ownership

Users should have the freedom to choose:

@sentenza
sentenza / employee-controller.scala
Last active September 29, 2018 21:51 — forked from anxious-coder-lhs/employee-controller.scala
Akka HTTP Employee RESTful APIs.
package com.codersbistro.controllers
import akka.actor.ActorSystem
import akka.event.Logging
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import akka.http.scaladsl.model.{StatusCodes}
import akka.http.scaladsl.server.Route
import akka.http.scaladsl.server.Directives._
import com.codersbistro.controllers.EmployeeController.QueryEmployee
import com.codersbistro.repository.EmployeeRepository
@sentenza
sentenza / scala-2.11-8_sbt-13.15.sh
Last active August 30, 2018 02:15 — forked from nmfzone/gist:2dc02fb73f30c47faf39005bd21d6331
Install Scala 2.12.2 and sbt 0.13.15 - Ubuntu 16.10 Yakkety
# Scala Installation
wget https://downloads.lightbend.com/scala/2.12.2/scala-2.12.2.deb
sudo dpkg -i scala-2.12.2.deb
# sbt Installation
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt
@sentenza
sentenza / ngrxintro.md
Last active August 8, 2018 14:03 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series
@sentenza
sentenza / introrx.md
Created August 8, 2018 13:42 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@sentenza
sentenza / pwa.md
Created July 12, 2018 07:43
Writing Progressive Web Apps - Useful online resources
@sentenza
sentenza / quaternions.scala
Created May 26, 2018 21:41 — forked from propensive/quaternions.scala
Quaternions in Scala
object Algebra {
// Build up increasingly complex algebras
trait Magma[T] {
def add(x : T, y : T) : T
}
trait Monoid[T] extends Magma[T] {
def zero : T
}
@sentenza
sentenza / test_extract_thumbnail.php
Created October 26, 2017 11:03
Extract a thumbnail using PHP and FFmpeg
<?php
class Extract {
const FFMPEG_PATH = '/usr/bin/ffmpeg';
public function exec($psSource, $psDest) {
$aOutput = [];
$aError = null;
$sCommand = sprintf("%s -i %s -vframes 1 %s 2>&1", self::FFMPEG_PATH, $psSource, $psDest);
echo 'Executing: ' . $sCommand;

Installing ffmpeg 3.4 and all the needed libraries

Dependencies

# From the official ffmpeg docs
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \
libsdl1.2-dev libtheora-dev libtool libvorbis-dev pkg-config texinfo zlib1g-dev \
yasm libx264-dev libmp3lame-dev libvpx-dev libfdk-aac-dev