Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Denson mdenson-dayspring

View GitHub Profile
@mdenson-dayspring
mdenson-dayspring / ClientEnvironmentListener.php
Created Jan 18, 2014
Pieces parts used to retrieve the browser time zone to a Symfony 2.3/Propel web application. By using these pieces you can get and display dates and times in the users timezone and store them in them correctly so that they can be displayed correctly in another users timezone.
View ClientEnvironmentListener.php
<?php
namespace MyApp\MyBundle\EventListener;
use DateTimeZone;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\DependencyInjection\ContainerInterface;
class ClientEnvironmentListener {
View colorclock.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Inspired by Hack-A-Day article http://hackaday.com/2012/01/25/very-accurate-clock-cant-be-read-accurately/.
#
# Author: Matthew Denson <mdenson AT dayspring-tech DOT com>
# Originally written for Processing: Feb 2, 2012
# Rewritten in Python/Tk: Oct 24, 2014
#
# Copyright (c) 2014 Dayspring Technologies, Inc.