Skip to content

Instantly share code, notes, and snippets.

View glauberramos's full-sized avatar

Glauber Ramos glauberramos

View GitHub Profile
var Robot = function(robot) {};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
//robot.ahead(100);
//robot.fire();
robot.turn(20);
//robot.back(0);
};
@glauberramos
glauberramos / robot.js
Created December 5, 2012 18:55
Dr. Dree
var Robot = function(robot) {
this.turnToRight = true;
this.invertedDirection = false;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if(this.turnToRight == true) {
robot.turn(5);
@glauberramos
glauberramos / robot.js
Created December 6, 2012 13:02 — forked from marano/robot.js
Shrimp Hunter
var aVera = true;
var Robot = function(robot) {};
var RobotState = function (rotateStep) {
data = {};
data.id = 0;
data.isLookingAtTarget = false;
data.timesShooting = 0;
data.rotateStep = rotateStep;
@glauberramos
glauberramos / shadow.css
Created December 7, 2012 22:08
Mother Fucker Shadow
text-shadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.2), 0 20px 20px rgba(0,0,0,.15);
@glauberramos
glauberramos / color
Last active December 15, 2015 08:19
Gist to change background color based on mouse position
$('body').mousemove(function(event) {
var width = $('body').width(),
height = $('body').height(),
axisX = event.pageX,
axisY = event.pageY;
var hue = Math.floor(axisX / width * 360),
saturation = Math.floor(axisY / height * 100),
lightness = Math.floor(axisY / height * 100);
@glauberramos
glauberramos / oo.js
Created May 28, 2013 18:20
Testing different ways of creating objects in javascript
//When using "new" keywork we are bounding the "this" context object to the variable that are being returned implicit in the function.
//When we overrite the return function we don't need to use the "new" keyword
//revealing module mode, functions outside the return code
function test1() {
function x(val) {
return 'test' + val;
}
return {
<span>
<p>
<label>
Address
</label>
<input type="text" id="address1" name="address1" value="" size="73">
</p>
<p>
<label>
-webkit-animation-name: intro-right;
-webkit-animation-duration: 0.5s;
-webkit-animation-iteration-count: once;
-webkit-animation-timing-function: ease-out;
-webkit-animation-delay: 0s;
-webkit-animation-fill-mode: both;
-webkit-animation-name: intro-left;
-webkit-animation-duration: 0.5s;
-webkit-animation-iteration-count: once;
setInterval([].forEach.bind($$("*"),function(a){a.style.outline="5px solid #"+(~~(Math.random()*(1<<24))).toString(16) }, 5), 10)
@glauberramos
glauberramos / api.js
Created October 5, 2015 18:17
Github api
$.ajax({
method: 'GET',
url: 'https://api.github.com/repos/servicosgovbr/cartas-de-servico/contents/cartas-servico/v3/servicos'
}).then(function(data) {
var servicos = data;
});