Skip to content

Instantly share code, notes, and snippets.

View ABeltramo's full-sized avatar

ABeltramo

  • Chatterbox Labs
  • London
View GitHub Profile
char *duplica(char *input) {
size_t len = strlen(input);
//Alloco un nuovo buffer
char *buffer = (char*) malloc(len+1);
if (buffer) {
memcpy(buffer, input, len);
buffer[len] = '\0'; //chiudo la stringa
}
@ABeltramo
ABeltramo / gist:1d914221d6c9932d46ba
Created March 23, 2015 13:58
C++ vector[ vector [ ] ]
//
// main.cpp
//
// Created by Ale on 23/03/15.
// Copyright (c) 2015 ABeltramo. All rights reserved.
//
#include <iostream>
#include <vector>
@ABeltramo
ABeltramo / gist:7dcc61286dda97177e1e
Last active August 29, 2015 14:19
CercaLeSomme
//
// main.cpp
// CercaLeSomme
//
// Created by Ale on 12/04/15.
// Copyright (c) 2015 ABeltramo. All rights reserved.
//
#include <iostream>
#include <vector>
Timer groundTimer = new Timer(); //Istanzio un ground timer
private Runnable runnable = new Runnable(){
public void run() {
groundTimer.tick(); //Eseguo la tick del timer
}
};
//Avvio l'esecuzione del runnable ogni secondo
private final int interval = 1000; // 1 Second
private Handler handler = new Handler();
@ABeltramo
ABeltramo / 1.RaspiConfig.md
Last active April 22, 2016 19:24
Launch this script to initialize, install and configure RaspberryPI

Raspberry PI Bootstrap

Series of command to start and configure an empty Raspbian image


What will be installed:

  • NodeJS
  • Transmission (Plus basic configuration)
  • MOTD
  • 192.168.1.193 IP Address
  • Static Mount point for my HD
  • TimeMachine enable (and configured)
@ABeltramo
ABeltramo / style.html
Last active September 26, 2015 11:59
Form Responsive
<style type="text/css">
/* ABeltramo - 26/09/2015 */
.wf-inputpos{ /* Centro tutti i controlli di input. */
margin-top: 0px !important;
margin-right: auto !important;
margin-bottom: 10px !important;
margin-left: auto !important;
}
#WFItem14446302 .wf-input{ /* Copia questo ID dal primo div sotto: <div id="WFItem14446302" ...*/
@ABeltramo
ABeltramo / 1.Install instruction.md
Last active October 19, 2015 17:51 — forked from genhack/gist:0b528e0351c27b1cb96f
Install libimobiledevice

Install libimobiledevice

Series of command to download and install libimobiledevice
Created by: Genhack && ABeltramo #GsmIta


How to start the magic?

curl --silent --location https://gist.githubusercontent.com/ABeltramo/5b7d0ac3031e1b5507f1/raw/install.sh -o installLibimobiledevice.sh
sudo sh installLibimobiledevice.sh 
@ABeltramo
ABeltramo / index.html
Last active October 23, 2015 09:18
[Phonegap] App Marco
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
@ABeltramo
ABeltramo / Esercizio2.pl
Last active October 21, 2015 15:11
Esercizio Prolog
byCar(auckland,hamilton).
byCar(hamilton,raglan).
byCar(valmont,saarbruecken).
byCar(valmont,metz).
byTrain(metz,frankfurt).
byTrain(saarbruecken,frankfurt).
byTrain(metz,paris).
byTrain(saarbruecken,paris).
@ABeltramo
ABeltramo / instruction.txt
Created February 6, 2016 09:03
Montare dischi Mac
*******************************
SE VUOI SOLO LEGGERE:
*******************************
Devi prima cercare il nome interno del disco (di solito se ne hai attaccato solo uno è /dev/sdb2) quindi da terminale:
sudo fdisk -l
Ti escono un sacco di informazioni ottieni una schermata del tipo:
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes