Skip to content

Instantly share code, notes, and snippets.

View MatteoRagni's full-sized avatar
🎱

Matteo Ragni MatteoRagni

🎱
View GitHub Profile
@MatteoRagni
MatteoRagni / server.rb
Last active May 11, 2016 09:03
Simple local webserver for pages testing
#!/usr/bin/ruby
# Local Server for site tests
%w|webrick optparse|.each do |gem|
raise LoadError, "Cannot load gem #{gem}" unless require gem
end
options = {}
@MatteoRagni
MatteoRagni / metropolis.css
Last active May 11, 2016 10:30 — forked from vhodges/metropolis.css
A version of the Beamer theme Metropolis for reveal.js
/**
* A simple theme for reveal.js presentations, derived from serif.css
* It's in the spirit of the Metropolis theme for beamer https://github.com/matze/mtheme
*
* This theme is Copyright (C) 2016 Vince Hodges, http://sourdoughlabs.com - it is MIT licensed.
*/
@import url(../../lib/font/fira/fira.css);
.reveal a {
@MatteoRagni
MatteoRagni / tictoc.rb
Created June 2, 2016 16:27
A simple tic toc timer in ruby. Timed operations are wrapped in a proc
def tictoc
tic = Time.now
yield
toc = Time.now
ret = toc - tic
puts "Time elapsed #{'%.3f' % ret}"
return ret
end
@MatteoRagni
MatteoRagni / PKGBUILD
Created June 3, 2016 10:04
GCC-4.9 for CUDA as secondary compiler on Linux Arch. Compiled as a package with `makepkg -sri`. Edited version of AUR package `gcc49`
# $Id$
# Maintainer: Matteo Ragni <info@ragni.me>
# Contributor: Matteo Ragni <info@ragni.me>
# Based on the original package by:
# Ruben Van Boxem <vanboxem.ruben@gmail.com>
# Allan McRae <allan@archlinux.org>
pkgname=('gcc49-cuda')
_pkgver=4.9
@MatteoRagni
MatteoRagni / test.py
Last active June 3, 2016 14:28
Timer in python, that implements a tic - toc in a context
from timer import Timer
with Timer():
print("do something")
with Timer():
print("do something else")
@MatteoRagni
MatteoRagni / TelegramNotifier.m
Last active June 9, 2016 10:08
A simple telegram notifier to send a message via bot when a simulation is completed, without the need to load an entire library for telegrams bot.
classdef TelegramNotifier
%TELEGRAMNOTIFIER is an extremely simple class to send a notification
% when a long simulation is ended.
properties
conf_file
config
end
methods
function self = TelegramNotifier(path)
%TELEGRAMNOTIFIER create a new telegram notifier object.
@MatteoRagni
MatteoRagni / ad.h
Last active October 29, 2016 20:35
Automatic Differentiation in C
/* Test for Automatic differentiation in C */
/* MIT License - Ragni Matteo 2016 */
#include <math.h>
typedef double number;
// Math constants
#define AD_PI 3.141592653589793
#define AD_E 2.718281828459045
@MatteoRagni
MatteoRagni / adhesion.dat
Last active November 15, 2016 13:53
Ex. for 15 Nov. Lecture
19.8
15.4
11.4
19.5
10.1
18.5
14.1
8.8
14.9
7.9
@MatteoRagni
MatteoRagni / Makefile.config
Last active November 25, 2016 09:00
Makefile configuration for CAFFE on my system (Arch Linux - GCC 6.1 - cuDNN - Cuda7.1 - Python3.5m - Matlab R2015b)
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
@MatteoRagni
MatteoRagni / .gitignore
Last active November 29, 2016 19:49
Class structure for Mr.CAS
*.dot