Skip to content

Instantly share code, notes, and snippets.

View dlferro's full-sized avatar

Daniel Ferro dlferro

View GitHub Profile
@dlferro
dlferro / gist:3004639
Created June 27, 2012 15:00
Leaflet Image Deepzoom
<html>
<head>
<link rel="stylesheet" href="lib/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="lib/leaflet.ie.css" />
<![endif]-->
</head>
<body>
<div id="map" style="width:1004px; height:748px; border: 1px solid black;"></div>
<script type="text/javascript" src="lib/leaflet-src.js"></script>
@dlferro
dlferro / Tap Config
Last active December 14, 2015 01:39
Tap Config
{
url: '../../tour.xml',
defaultLanguage: 'en',
trackerID: 'UA-20840633-3',
navigationControllers: [
{ id: 'keypad', label: 'Keypad', route: '', icon: '' },
{ id: 'stop-list', label: 'StopList', route: '', icon: '' },
{ id: 'map', label: 'Map', route: '', icon: '' }
],
tourSettings: {
module.exports = function(grunt) {
var precompileTemplates;
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
name: 'TAP',
version: '0.1.0',
author: 'Indianapolis Museum of Art',
import com.francisli.processing.http.*;
import processing.serial.*;
Serial myPort; // The serial port
int value = 0;
float oldValue;
PFont InstagramFont;
<html>
<head>
</head>
<body>
<div id="post">
<p id="test" data-textannotation-id="3a850d8670a8255343a9451b42f53eb3">Derrick Rose underwent a successful repair of his medial meniscus today. That's the good news. The bad news is that the Bulls have announced that Rose is done for the season.</p>
<p data-textannotation-id="ca49ebe0a4b38a6785a22c3fe1343c84">The long return time for Rose likely means that he had the meniscus repaired, instead of removed, all together or partially. That it could be salvaged is a good sign for future recovery, but that procedure takes longer to recover.</p>
<aside data-ids="482818589">RELATED
<div>
@dlferro
dlferro / Drupal
Created February 28, 2014 03:24
ExactTarget Digital Marketing style guides.
TODO
module ApiPagination
Infinity = 1.0/0
class Range < Grape::Validations::SingleOptionValidator
def validate_param!(attr_name, params)
unless (!@required && params[attr_name].nil?) || @option.include?(params[attr_name])
throw :error, status: 400, message: "#{attr_name}: must be within #{@option}"
end
end
end
@dlferro
dlferro / gist:d826b8da5f418d9c8317
Created October 7, 2014 18:47
Application Controller
App.ApplicationController = Em.ArrayController.extend({
itemController: 'socialItem',
unapprovedItems: function() {
return this.get('model').filterProperty('state', 0);
}.property('model.@each.state'),
});
<html>
<head>
<script type="text/javascript">
App.ApplicationAdapter = DS.RESTAdapter.extend({
host: 'http://127.0.0.1:8000/api/content',
headers: function() {
return {'X-CSRFToken': $('meta[name="csrf-token"]').attr('content')};
}.property("session.authToken")
});
@dlferro
dlferro / gist:480ef885fa4744681976
Last active August 29, 2015 14:17
Randomizing Offers
%%[
SET @randomVal = RANDOM(0, 100)
if randomVal < 60 THEN
// display offer for 15% off
ELSE IF randomVal < 20 THEN
// display offer for 25% off
ELSE IF randomVal < 15 THEN
// display offer for 30% off
ELSE IF randomVal < 5 THEN