This file contains hidden or 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) { | |
}; | |
var save_gun_positon = ''; | |
Robot.prototype.onIdle = function(ev) { |
This file contains hidden or 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
Some quick notes from http://www.youtube.com/watch?v=UJPdhx5zTaw | |
Don't mix types ( be sure the array is only of one type ) | |
Don't read out of bounds | |
Avoid operations with undefined values ( always initialize ) | |
Don't add a new properties to the object during runtime | |
Initialize all object members in constructor functions | |
Always initialize object members in the same order | |
Use 31 bit signed numbers in critical calculations | |
Don't preallocate arrays elements | |
Don't delete elements from arrays |
This file contains hidden or 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 | |
echo "Enter a host name (e.g. example.com):"; | |
read domain; | |
echo "" | |
echo 'IP ADDRESSES' | |
ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' | |
echo "Enter IP ADDRESS:"; | |
read ipaddress; |
This file contains hidden or 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
add | |
sudo tc qdisc add dev eth0 root netem delay 250ms loss 20% reorder 25% 50% | |
----------------------- | |
change ( I need to edit this, just putting some examples for now ) | |
tc qdisc change dev eth0 root netem delay 250ms loss 20% reorder 25% 50% ) | |
tc qdisc change dev eth0 root netem gap 5 delay 100ms reorder 25% 69% loss 25% ) |
This file contains hidden or 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
var https = require('https'); | |
var options = {method: 'HEAD', host: 'user.tent.is', path: '/'}; | |
var req = https.request(options, function(res) { | |
console.log(JSON.stringify(res.headers)); | |
} | |
); | |
req.end(); | |
req.on('error', function(e) { |
This file contains hidden or 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
[ | |
"a", | |
"about", | |
"above", | |
"across", | |
"after", | |
"afterwards", | |
"again", | |
"against", | |
"all", |
This file contains hidden or 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
/*global gmap */ | |
function getUserLocation(map) { | |
if (navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(function (position) { | |
var point = new google.maps.LatLng(position.coords.latitude, | |
position.coords.longitude); | |
if (typeof getUserLocation.user_marker == 'undefined') { | |
getUserLocation.user_marker = new google.maps.Marker({ | |
position:point, |
This file contains hidden or 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
try { | |
localStorage.setItem('test', 'test'); | |
} catch (err) { | |
if ((err.name).toUpperCase() == 'QUOTA_EXCEEDED_ERR') { | |
document.write('<div style="padding:5%;margin:5%;background:#777;color:white;height:90%">We don\'t seem to be able to store the information needed for this app to work on your phone.<br /><br /> It\'s probably because you have enabled private browsing mode. If you\'d like to disable private browsing go to settings section on your phone.</div>'); | |
} | |
} |