Skip to content

Instantly share code, notes, and snippets.

View YenTheFirst's full-sized avatar

Talin YenTheFirst

  • Opendoor
  • San Francisco
View GitHub Profile
@YenTheFirst
YenTheFirst / wtf.rb
Created July 26, 2011 03:47
WTF ActiveSupport::TimeZone
$ rails console
> a = Time.zone.now # => Mon, 25 Jul 2011 23:47:52 EDT -04:00
> b = Time.zone.parse(a.to_s) # => Mon, 25 Jul 2011 23:47:52 EDT -04:00
> c = Time.zone.parse(a.strftime("%Y-%m-%d %H:%M:%S.%N %z")) # => Mon, 25 Jul 2011 23:47:52 EDT -04:00
> a == b # => false
> a == c # => true
> a.nsec # => 583744338
> b.nsec # => 0
> c.nsec # => 583744338
@YenTheFirst
YenTheFirst / index.html
Created May 26, 2011 17:57 — forked from mlevans/index.html
Displaying Map Tiles from TileStream
<!Doctype html>
<html>
<head>
<title>311 Density</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://github.com/CloudMade/Leaflet/raw/master/dist/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="https://github.com/CloudMade/Leaflet/raw/master/dist/leaflet.ie.css" /><![endif]-->
</head>
<body>