Skip to content

Instantly share code, notes, and snippets.

View aknosis's full-sized avatar
🏔️
Working Remotely

Paul Giberson aknosis

🏔️
Working Remotely
View GitHub Profile
@aknosis
aknosis / gist:997144
Created May 28, 2011 19:32
Execute callback once when a google map is loaded (google maps api)
//Fill in the blanks :)
var map = new google.maps.Map(),
tileListener = google.maps.event.addListener(map,'tilesloaded',fixMyPageOnce);
function fixMyPageOnce(){
//immediately remove the listener (or this thing fires for every tile that gets loaded, which is a lot when you start to pan)
google.maps.event.removeListener(tileListener);
}
@aknosis
aknosis / calendar.twig
Created October 22, 2012 15:52
Table based calendar only using Twig
{#
time can be any string acceptable by http://www.php.net/strtotime, the
template will output that time's month.
If you don't want to pass in a date you can set time like this:
{% set time = "now"|date("U") %}
{% set time = "December 2012"|date("U") %}
How ever you want to output items onto the calendar is a different issue,
but I'd assume pushing everything into an array numerically indexed by that day: