Skip to content

Instantly share code, notes, and snippets.

View joelongstreet's full-sized avatar

Joe Longstreet joelongstreet

  • Kodable
  • Kansas City, Missouri - United States
View GitHub Profile
[
{
"name" :"Joe",
"favorite_foods" : ["pizza", "eggs", "lasagna"]
},
{
"name" : "Ross",
"favorite_foods" : ["lasagna"]
},
{
/* http://github.com/mindmup/bootstrap-wysiwyg */
/*global jQuery, $, FileReader*/
/*jslint browser:true*/
(function ($) {
'use strict';
var readFileIntoDataUrl = function (fileInfo) {
var loader = $.Deferred(),
fReader = new FileReader();
fReader.onload = function (e) {
loader.resolve(e.target.result);
@joelongstreet
joelongstreet / config.json
Created October 15, 2013 23:35
sample gutenberg config
[{"title":"Email","templates":{"preview":"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'> <head> <custom name='opencounter' type='tracking'> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> <title><%= newsletter.title %></title> </head> <body> <table width='600px' style='font-family:Helvetica, Arial, sans-serif; font-size:1em'; > <tr> <td colspan='5'><img src='http://f.cl.ly/items/440H2i061W2D143r190t/header.jpg' /></td> </tr> <tr> <td colspan='1' style='font-size:.8em; padding-bottom:15px;'><a href='#'>Read it Now on Passport</a></td> <% var modifiedTitle = newsletter.title.replace('On the Radar - ', '') %> <td colspan='4' style='vertical-align:top; font-size:.8em; text-align:right; color:#636363;'><%= modifiedTitle %></td> </tr> <% for(var i=0; i<stories.length; i++) {%> <% if(stories[i].sort_index
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'> <head> <custom name='opencounter' type='tracking'> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> <title>On the Radar - October 8, 2013 (Joe's Test)</title> </head> <body> <table width='600px' style='font-family:Helvetica, Arial, sans-serif; font-size:1em'; > <tr> <td colspan='5'><img src='http://f.cl.ly/items/440H2i061W2D143r190t/header.jpg' /></td> </tr> <tr> <td colspan='5' style='font-size:.8em; text-align:right; color:#636363;'>On the Radar - October 8, 2013 (Joe's Test)</td> </tr> <tr draggable='true' class='draggable' data-storyId='525d9190cb843f0000000001'> <td style='vertical-align:top;'> <img draggable='false' style='width:190px;' src='https://s3.amazonaws.com/gutenberg-vml/dffdc4e9c20dcec27c21503c79eb69e
@joelongstreet
joelongstreet / garbage.m
Created October 10, 2013 20:42
garbage
/**
* Your Copyright Here
*
* Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
* and licensed under the Apache Public License (version 2)
*/
#import "TiModule.h"
#import "ComAudiosyncModule.h"
#import "TiBase.h"
#import "TiHost.h"
View = require 'views/base/view'
template = require 'views/templates/fanview/center/demographics'
module.exports = class Demographics extends View
template: template
template = null
autoRender: true
tagName: 'div'
className: 'accordion-inner row-fluid'
completeTask:(e)=>
e.preventDefault() if e
e.stopPropagation() if e
@toggleStatus()
status = @model.get('status');
@model.save {
status: status
}, {
success: =>
unless @removeTaskTimeout
@joelongstreet
joelongstreet / ImageController.js
Created September 27, 2013 19:01
some description
/**
* ImageController
*
* @module :: Controller
* @description :: Contains logic for handling requests.
*/
var magik = require('gm');
var fs = require('fs');
var path = require('path');
@joelongstreet
joelongstreet / stackato.yml
Last active December 24, 2015 02:39
sample stackato config
name: Gutenberg
requirements:
running:
unix:
- graphicsmagick
framework:
type: node
services:
fs_gutenberg_photos: filesystem
ignores: ["node_modules", ".git", "uploads", ".tmp"]
@joelongstreet
joelongstreet / CleanMicrosoftWordHtml.js
Created September 21, 2013 18:10
Cleans html when pasting text from Microsoft Word. Will remove all inline styling and extraneous markup attributes. Allows you to specify which html tags should be allowed.
// Pasting from Microsoft word is an ABSOLUTE DISASTER
// this method removes the endless gobs of garbage produced
// by the world's worst, yet most popular, text editor
var allowedTags = ['A', 'DIV', 'SPAN', 'B', 'I', 'EM', 'STRONG', 'P'];
var cleanHTML = function(htmlString){
// If it doesn't look like a tag, return the string
if(htmlString.charAt(0) != '<') return htmlString
try{ $(htmlString) }
catch(e){ return htmlString }