Skip to content

Instantly share code, notes, and snippets.

@onlab
onlab / gist:71a863feed01f79e7b7a
Last active August 29, 2015 14:23
PHP DateTime bug when using DateTimeZone
<?php
# 1st case
$baseDate = \DateTime::createFromFormat(\DateTime::ISO8601, '2015-06-23T18:00:00-0300');
$originalTimeZone = $baseDate->getTimezone();
echo 'Case #1:' . PHP_EOL;
echo '----- Everything works fine here -----' . PHP_EOL;
echo "SET America/Sao_Paulo \t" . $baseDate->format(\DateTime::ISO8601) . PHP_EOL;
@onlab
onlab / robot.js
Created December 6, 2012 16:24
HeadShot
//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.ahead(11);