Skip to content

Instantly share code, notes, and snippets.

@hinok
hinok / gist:a3d413004df3e1ff4bb0
Created January 18, 2015 14:36
Improved {{#each}} for Ember 1.9 / Handlebars 2.0.0
/**
A replacement for #each that provides an index value (and other helpful values) for each iteration.
Unless using `foo in bar` format, the item at each iteration will be accessible via the `item` variable.
Simple Example
--------------
```
{{#eachIndexed bar in foo}}
{{index}} - {{bar}}
{{/#eachIndexed}}
@ju-popov
ju-popov / timestamp.py
Last active April 7, 2021 16:09
Python DateTime / Timestamp Convertion
######################################################################
# CURRENT AWARE LOCAL DATETIME
######################################################################
from datetime import datetime
from tzlocal import get_localzone
local_tz = get_localzone()
local_dt = datetime.now(local_tz)