Skip to content

Instantly share code, notes, and snippets.

View rubentd's full-sized avatar

Ruben Torres rubentd

View GitHub Profile
<link rel="stylesheet" href="css/gifplayer.css">
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/jquery.gifplayer.js"></script>
<img id="banana" src="img/banana.png" data-gif="img/banana-animated.gif" class="gifs"/>
<img id="cheetah" src="img/cheetah.png" class="gifs"/>
<img id="mario" src="img/mario.png" class="gifs"/>
<script>
$('.gifs').gifplayer();
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/jquery.radios-to-slider.js"></script>
<script>
$(document).ready( function(){
$("#radios").radiosToSlider();
});
</script>
<div id="radios">
<button id="toasty-button" style="padding:10px;">Show toasty</button>
<link rel="stylesheet" href="toasty.css">
<script type="text/javascript" src="jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="jquery.toasty.js"></script>
<script>
$(document).ready( function(){
$("body").toasty();
<div id="cubeman" class="cubeman-wrap">
<span class="cubeman-all">
<span class="cubeman-head">
<span class="face front"></span>
<span class="face back"></span>
<span class="face top"></span>
<span class="face bottom"></span>
<span class="face left"></span>
<span class="face right"></span>
</span>
//BASE:
@head-width:50px;
@head-height:60px;
@head-depth:50px;
@body-width:25px;
@body-height:40px;
@body-depth:25px;
/**
* Cubeman
*/
#cubeman{
margin-top:100px;
}
#spiderman{
margin-top:200px;
<script src="../js/jquery.dirrty.js"></script>
<script>
$("#my-form").dirrty({
onDirty: function(){
$("#status").html("dirty");
$("#save").removeAttr("disabled");
$("#status").removeClass("clean");
},
onClean: function(){
$("#status").html("clean");
$("#form-id").dirrty("isDirty");
@rubentd
rubentd / client-server.js
Last active August 29, 2015 14:16
tanks-server-client
client.on('joinGame', function(tank){
console.log(tank.id + ' joined the game');
var initX = getRandomInt(40, 900);
var initY = getRandomInt(40, 500);
client.emit('addTank', { id: tank.id, type: tank.type, isLocal: true, x: initX, y: initY, hp: TANK_INIT_HP });
client.broadcast.emit('addTank', { id: tank.id, type: tank.type, isLocal: false, x: initX, y: initY, hp: TANK_INIT_HP} );
game.addTank({ id: tank.id, type: tank.type, hp: TANK_INIT_HP});
});
setInterval(function(){
g.mainLoop();
}, INTERVAL);
mainLoop: function(){
if(this.localTank != undefined){
this.sendData(); //send data to server about local tank
}
if(this.localTank != undefined){