Skip to content

Instantly share code, notes, and snippets.

David Sferruzza dsferruzza

Block or report user

Report or block dsferruzza

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am dsferruzza on github.
  • I am dsferruzza (https://keybase.io/dsferruzza) on keybase.
  • I have a public key ASDhLMTEJ3pt27CMGGyFX6AzJ88ca2F0bEKll-KSHVWj2go

To claim this, I am signing this object:

@dsferruzza
dsferruzza / default.nix
Last active Mar 28, 2017
VeraCrypt for Nixpkgs
View default.nix
{ fetchurl, stdenv, pkgconfig, nasm, fuse, wxGTK30, devicemapper, makeself,
wxGUI ? true
}:
stdenv.mkDerivation rec {
name = "veracrypt-${version}";
version = "1.19";
src = fetchurl {
url = "https://launchpad.net/veracrypt/trunk/${version}/+download/VeraCrypt_${version}_Source.tar.gz";
@dsferruzza
dsferruzza / ArduinoML.scala
Created Jul 9, 2015
Arduino Internal DSL in Scala, following the lecture by @petitroll at EJCP2015
View ArduinoML.scala
case class ArduinoML(transitions: Seq[Transition]) {
def genCode: String = {
val statePrefix = "state_"
val init = transitions.head.from
val bricks = transitions.foldLeft(Set.empty[Brick])((acc, cur) => acc ++ cur.from.actuators ++ cur.to.actuators ++ cur.cond.sensors)
val br = bricks
.map(" " + _.genCode)
.mkString("\n")
@dsferruzza
dsferruzza / gh-pages-creation.sh
Last active Aug 29, 2015
Git hook to keep gh-pages branch up to date with master
View gh-pages-creation.sh
# This needs to be executed once to create the "gh-pages" branch
git checkout --orphan gh-pages
git rm -rf .
# This is the part to adapt
FILE="site/index.html"
git checkout master -- $FILE
git mv $FILE index.html
git commit -am "First commit"
@dsferruzza
dsferruzza / stop-after-this-track.lua
Created Jun 8, 2014
This is a Proof Of Concept of a feature I miss in VLC: "stop after this track"
View stop-after-this-track.lua
--[[
This is a Proof Of Concept of a feature I miss in VLC: "stop after this track"
This is my first time hacking VLC, so I have some questions:
1) Is "descriptor().description" useful? (I can't find how it is used by VLC)
2) When is "meta_changed()" called and what is it supposed to return?
3) Is there a VLC Lua API's documentation? (I read https://www.videolan.org/developers/vlc/share/lua/README.txt but I had to pick up some stuff from existing extensions on GitHub to get this done)
4) Is there a "standard" way to handle localization?
5) Is it possible to add an entry to the tray icon's context menu? (How?)
@dsferruzza
dsferruzza / gist:9529264
Created Mar 13, 2014
Draft of AST for simpleSqlParser
View gist:9529264
/*
SELECT t1.col1, t2.col2 AS c2, NOW() AS "current time"
FROM table1 AS t1
LEFT JOIN table2 AS t2 ON t1.id = t2.id_table1
WHERE t1.col1 > 0 AND t1.col1 < 50
ORDER BY t2.col2 ASC
LIMIT 10,5
*/
var ast = {
@dsferruzza
dsferruzza / gist:6069617
Last active Dec 20, 2015
AngularJS: resources that handle PUT call for modifications
View gist:6069617
// Inspired from: http://kirkbushell.me/angular-js-using-ng-resource-in-a-more-restful-manner/
var resource = angular.module('Resource', ['ngResource']);
resource.factory('Resource', ['$resource', function($resource) {
return function(url, params, methods) {
var defaults = {
update: { method: 'put', isArray: false },
create: { method: 'post' }
};
You can’t perform that action at this time.