This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO - remove dependencies on jquery, underscore, require, and backbone. | |
define(function (require) { | |
'use strict'; | |
var _ = require('underscore'); | |
var Backbone = require('backbone'); | |
var transitionEnd = [ | |
'transitionend', | |
'webkitTransitionEnd', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@function lookup ($targetKey, $map, $index:2, $default:'') { | |
@each $entry in $map { | |
@if length($entry) >= $index { | |
$key: nth($entry, 1); | |
$value: nth($entry, $index); | |
@if $key == $targetKey { | |
@return $value; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exportService.build { | |
format 'excel' | |
out response | |
filename 'facilities' | |
extension 'xls' | |
objects Contact.list(params) | |
parameters([title: 'Facilities']) | |
fields { | |
name ('Name') {obj, val -> obj?.facility?.name} | |
abbreviation ('Abbr') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media only screen and (min-width: 320px) { | |
/* Small screen, non-retina */ | |
} | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $inputEl = this.$inputEl, //get a jquery element | |
$tmp = $('<span />'), //create a span | |
$body = $('body'); // get the body | |
$tmp.html(_.escape($inputEl.val())); | |
$body.append($tmp); | |
var theWidth = $tmp.width(); | |
$tmp.remove(); | |
var widthToSet = (14 + theWidth) + 'px'; | |
$inputEl.width(widthToSet); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from uuid import uuid1 | |
import random | |
import json | |
import time | |
import sys | |
import pymongo | |
import datetime | |
start = time.time() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def progressBar = { max, closure -> | |
def template = "\r[%s] %s" | |
def progress = 0 | |
def percent = 0 | |
def barLength = 100 | |
def progressRatio = barLength / 100 | |
while (progress < max) { | |
def progressBuffer = new StringBuilder(); | |
def step = closure() |
NewerOlder