Skip to content

Instantly share code, notes, and snippets.

View mspanish's full-sized avatar

Stacey Reiman mspanish

View GitHub Profile
$.ajax({ url: "info.md", context: document.body, success: function(mdText){ //where text will be the text returned by the ajax call var converter = new Showdown.converter(); var htmlText = converter.makeHtml(mdText); $(".outputDiv").append(htmlText); //append this to a div with class outputDiv } });
// Changes XML to JSON
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) { // element
// do attributes
if (xml.attributes.length > 0) {
obj["@attributes"] = {};
/**
* User: rupin_t
* Date: 6/27/13
* Time: 5:42 PM
*/
/**
* Custom the template loading.
* Each template is downloaded from the server and the cached.
* @param templateId
@mspanish
mspanish / singly-mongoose.js
Last active December 15, 2015 23:39
Singly Passport Express Authentication with Mongoose/Mongodb Integration - this is my new passport.js file, along with my User model for Mongoose, and the 2 routes I use with this system.
// db.js (just the User model)
var UserSchema = new Schema({
// _id: String,
username: String,
name: String,
gravatar: String,
email: String,
provider: String,
services: String,
@mspanish
mspanish / index.html
Created February 6, 2013 21:29
A CodePen by Stacey Reiman.
<div id="buttonbar"><img id="memoryToggle" onClick="memoryMode()" class="buttonBar" src="http://www.instaspanish.com/dev/memory.svg" height="75px" width="150px" /><img id="matchToggle" class="buttonBar" onClick="matchMode()" src="http://www.instaspanish.com/dev/match.svg" height="75px" width="150px" /></div>