Skip to content

Instantly share code, notes, and snippets.

View leonardfactory's full-sized avatar
Inventing

Leonardo Ascione leonardfactory

Inventing
View GitHub Profile
La discussione della tesina avra' luogo in concomitanza con gli appelli d'esame, pur non essendo necessario consegnare la tesina nello stesso appello in cui si sostiene la prova scritta. La presentazione della tesina deve avvenire attraverso una relazione strutturata (in linea di massima) come segue:
- Introduzione contenente le specifiche del progetto
- Discussione delle scelte di progetto e realizzative, e delle tecniche e metodologie generali usate
- Breve manuale uso dei programmi (come compilare, come installare)
- Tutti i sorgenti del progetto (escluse eventuali librerie esterne e header di sistema)
All'atto della discussione della tesina e' inoltre necessario portare un dispositivo di memoria USB con tutti i sorgenti in modo da rendere possibile la verifica del corretto funzionamento dei moduli sviluppati.
var count = 0;
for(var i=1;i<=100;i++){
count+= (i.toString().match(/9/g) || []).length
}
console.log(count);
@leonardfactory
leonardfactory / gist:5605549
Created May 18, 2013 19:40
How to add SSH PublicKey login to your server, stringed procedure

#How to add SSH PublicKey login to your server

  • ssh-keygen
  • Use no passphrase, use custom file like my_identity_rsa + my_identity_rsa.pub
  • port install ssh-copy-id
  • ssh-copy-id -i my_identity_rsa.pub root@server // It takes care of everything like permissions etc.
  • chmod g-w,o-w ~ // Ensure home directory is not writable by others and groups.
  • ssh-add my_identity_rsa // Let me use this key
@leonardfactory
leonardfactory / old_redcarpet_pygments.rb
Created May 7, 2013 14:28
Old plugin to get line numbers and code highlighting available on Jekyll <= 0.12
require 'redcarpet'
require 'pygments'
# Provides a custom Redcarpet renderer with some tweaks for code blocks and links.
class HTMLwithPygmentsCodeblocks < Redcarpet::Render::HTML
def initialize(extensions = {})
super extensions.merge(:link_attributes => { :target => "_blank" }) # Open link in new window
end
def block_code(code, language)
@leonardfactory
leonardfactory / redcarpet_pygments.rb
Created May 7, 2013 14:22
Custom Jekyll markdown converter allowing us to configure Pygments and other nice things like inline code styling.
# Jekyll v1 made internal markdown converters.
# Here we change the module, allowing our custom parser to be used.
module Jekyll
module Converters
class Markdown < Converter
safe true
pygments_prefix "\n"
pygments_suffix "\n"