Skip to content

Instantly share code, notes, and snippets.

class this.jsTimezone
timezone: null
@local: () ->
tz = new jsTimezone()
tz.determine()
###
Gets the offset in minutes from UTC for a certain date.
token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[\-+]\d{4})?)\b/g
timezoneClip = /[^\-+\dA-Z]/g
i18n =
dayNames: [
'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat',
'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
]
monthNames: [
@jkintscher
jkintscher / ember-ror-setup.md
Last active December 10, 2015 20:38
Set up Ember.js on top of Ruby on Rails

rails new app_name -m http://emberjs.com/template.rb

Add config.ember.variant = :development to config/application.rb

rails g ember:install --head

Copy handlebars.js to vendor/assets/javascripts/

Update revision in app/assets/javascripts/store.js to latest (11)

@jkintscher
jkintscher / sparkline.svg
Last active December 10, 2015 11:59
Simple SVG Sparklines by Stuart Langridge (http://kryogenix.org/days/2012/12/30/simple-svg-sparklines)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jkintscher
jkintscher / saddle.php
Created February 13, 2012 15:58
Find existing saddle points in any given 2-dimensional matrix
<?php
function find_saddle_points($arr) {
$points = array();
// traverse the passed matrix by row
foreach($arr as $i => $row) {
// get the highest value from each row
$max = max($row);