This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.rotateCannon(360); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Script per il controllo della batteria e della temperatura | |
while : | |
do | |
BATT=$(acpitool -b | grep -Po ", (.*)\." | sed -e s/,\ //g | sed -e s/\\.//g) | |
TEMP=$(cat /sys/class/hwmon/hwmon0/temp1_input) | |
if [ $BATT -lt 5 ]; then | |
xmessage "La batteria e' sotto il 5% il pc verra' spento in 8 secondi" -center -timeout 8 | |
halt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# upfile | |
# Copyright (C) 2012 Domenico Luciani aka DLion | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# This program is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*############################################################################### | |
*# @Author : Domenico Luciani aka DLion | |
*# @Description: Simple snippet for move the pointer on the screen using a joystick | |
*# @How compile: g++ <source> -o <binary> -lplibjs -lplibsl -lplibsm -lplibul -lm -lX11 | |
*# @Copyright : 2012 | |
*# @Site : http://www.about.me/DLion | |
*# @License : GNU AGPL v3 http://www.gnu.org/licenses/agpl.html | |
*###############################################################################*/ | |
#include <X11/Xlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
long sizeFile(FILE *file) | |
{ | |
long pos_now,size; | |
//Posizione attuale | |
pos_now = ftell(file); | |
//Mi posiziono alla fine del file | |
fseek(file,0,SEEK_END); | |
//Prendo la dimensione | |
size = ftell(file); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Rilevatore di bordi con canny | |
* Snippet by Domenico Luciani aka DLion | |
*/ | |
#include <highgui.h> | |
#include <cv.h> | |
int main() | |
{ |
NewerOlder