Skip to content

Instantly share code, notes, and snippets.

@aanton
aanton / timezones.php
Created April 4, 2014 07:46
Test timezones in PHP
<?php
$serverTimezone = 'Europe/Madrid';
$timezones = ['America/Los_Angeles', 'America/Mexico_City', 'Atlantic/Canary', 'Europe/Madrid'];
$tmst = time();
$datetimeNow = new DateTime('now', new DateTimeZone($serverTimezone));
$datetimes = array();
foreach ($timezones as $timezone)
@aanton
aanton / Null.php
Created November 25, 2013 07:26
Null PHP Class
<?php
class Null
{
private static $instance;
public function __call($name, $arguments)
{
if (strpos($name, 'is') === 0 || strpos($name, 'has') === 0)
{
@aanton
aanton / Responsive-layout.markdown
Created October 10, 2013 12:57
A Pen by Armando Anton.
@aanton
aanton / 10gen-extract-videos.js
Created June 19, 2013 08:43
Get all videos URLs of a week in a course from education.10gen.com using web scrapping, javascript, jquery and browser console
/*
Instructions:
1. Log in with your account and go to the desired course
2. Open the courseware tab
3. Configure the week variable
4. Copy this code and paste it in the browser console
*/