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
@joelongstreet
joelongstreet / cors.xml
Created March 6, 2013 21:21
Sample AmazonS3 Cors configuration to allow cross domain requests and expose headers.
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
<ExposeHeader>x-amz-meta-author</ExposeHeader>
<ExposeHeader>x-amz-meta-caption</ExposeHeader>
<AllowedHeader>x-amz-*</AllowedHeader>
@joelongstreet
joelongstreet / GistEmbed.txt
Created March 19, 2013 13:20
A sample showing how to create a gist on the vml intranet (Jude).
[embed]https://gist.github.com/joelongstreet/5052198[/embed]
@joelongstreet
joelongstreet / EmbeddingContent.text
Last active December 15, 2015 04:59
A sample showing how to embed various types of content into Jude. This gist is referenced on Jude.
Vimeo [embed]https://vimeo.com/48535034[/embed]
Youtube [embed]http://www.youtube.com/watch?v=LeaAHv4UTI8[/embed]
Google Maps [embed]https://maps.google.com/maps?q=Lake+Como...[/embed]
MeetUp [embed]http://www.meetup.com/nodekc/[/embed]
Pinterest [embed]http://pinterest.com/pin/229894755950834306/[/embed]
Dribble [embed]http://dribbble.com/shots/992837-Point[/embed]
Wikipedia [embed]http://en.wikipedia.org/wiki/Charles_babbage[/embed]
@joelongstreet
joelongstreet / sample.html
Created March 25, 2013 18:55
HTML Entities available on Jude.
<p>The article below shows common html entities and how each will render on the intranet. See the bottom for code used in this post.</p>
<br /><br />
<h2>Heading 1 or 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<br /><br /><br />
@joelongstreet
joelongstreet / bangproof.html
Last active December 19, 2015 01:39
HTML version of a carnival strong man game.
<!DOCTYPE html>
<html>
<head>
<title>Bang Proof</title>
<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1' />
<script src='http://code.jquery.com/jquery-1.10.1.min.js' type='text/javascript'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js'></script>
<script>
$(function(){
define([
'chaplin',
'models/base/model'
], function(Chaplin, Model) {
'use strict';
var Collection = Chaplin.Collection.extend({
model : Model,
parms : {},
listen : function(){
@joelongstreet
joelongstreet / S3Downloader.js
Created September 11, 2013 15:55
Download all files from an amazon S3 bucket using node.
// Config
var bucketName = 'xxx';
var saveFileDir = 'files';
var creds = {
key : 'xxx',
secret : 'xxx',
bucket : bucketName
};
@joelongstreet
joelongstreet / publication-view.js
Created September 18, 2013 14:23
publication-view.js
define([
'chaplin',
'views/base/view',
'models/newsletter',
'text!templates/publication.hbs'
], function(Chaplin, View, Newsletter, template){
'use strict';
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ];
@joelongstreet
joelongstreet / publication-controller.js
Created September 18, 2013 14:24
publication-controller.js
define([
'controllers/base/controller',
'models/base/collection',
'models/base/model',
'views/publications-view',
'views/publication-view',
'views/newsletters-view'
], function(Controller, Collection, Model, PublicationsView, PublicationView, NewslettersView){
'use strict';
@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 }