This file contains 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
/* Animation Queue Object using vanilla JavaScript | |
* by: Michael Rosata | |
* https://jsfiddle.net/mrosata/gb96gcme/2/ | |
*/ | |
function AnimeQ (int) { | |
this.intv = parseInt(int,10) || 10; | |
this.queue = []; | |
} | |
AnimeQ.prototype.addToQueue = function (item) { | |
item.animating = true; |
This file contains 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
#!/usr/bin/python | |
# Udacity exercise. Just posted the code here to help anyone who wanted to see the work behind my posted result. | |
__author__ = 'Michael Rosata mrosata1984@gmail.com' | |
__package__ = '' | |
from random import random | |
import turtle | |
class TurtleArtist(turtle.Turtle): | |
_origin = (0, 0) |
This file contains 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
/** | |
* Setup Password Hashing Object | |
* This will hash the passwords on the client side so that: | |
* 1. We don't ask people to submit sensitive data over the wire | |
* 2. We don't have to store plaintext passwords in MySQL | |
*/ | |
// I wrapped this is private scope because there's no reason to trust wild code. | |
var passwordHasher = (function(window, undefined) { | |
// These scripts are open-source up on https://code.google.com/p/crypto-js/#Hashers - (More on the website too!) |
This file contains 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
/** | |
* This was a refactor to a loop that was building events on a series of toggle switches. | |
* The nature of the events binding would break upon ajax page loading (if it overwrote bs-toggles). | |
* To make it dynamic I had to refactor original code (top) to the nice code (bottom) which is | |
* independant of toggle switches themselves. It listens on a anscestor container. An element which | |
* will never be overwritten by ajax. On some pages this would have to be <body> perhaps. | |
*/ | |
// Original Code. Author unknown. | |
$('.switch-toggle').each(function(i,ob){ |
This file contains 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
/****** | |
* @author: Steven Spielburg, j/k, it's me! | |
* @since: Long time away | |
* @galaxy: Far far away | |
* | |
* Usually our .htaccess would build a proper query string so that index.php can handle any request for us. | |
* Now we have no .htaccess except on the api server. So we must map our own templates. This pattern below | |
* will serve as almost middleware to AjaxHustleBunny. Normally AHB would make HTTP request and index.php | |
* would return the correct page, then AHB would fire enpoint event (`controller/action`, id) to all JS | |
* modules, but now instead AHB will call aroma.loadAssets() with params and aroma.loadAssets shall return |
This file contains 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
/** | |
* HistoryImplement for SPA | |
* -- I created an application that was both a SPA and also took advantage of the | |
* pushState API. When I ported the app to Cordova, the back button no longer | |
* worked since I had used custom ajax nav and handled url using pushState. I | |
* easily solved the problem and I'm sure it's similiar to how many others have | |
* solved it as well. | |
*/ | |
function HistoryImplement (callback, max) { | |
// max history |
This file contains 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
""" | |
Merge together .csv files. I'm creating this because I have 30 .csv files which need to be concatenated | |
together. This uses the headers from 1 file and then will concate w/o headers 1 through n such as : | |
"customer-data.csv", "customer-data (1).csv" ... "customer-data (n).csv" | |
""" | |
# Todo: make use of the csv module and check headers from each file to make sure data lines up. | |
# Todo: allow explicit filenames to be passed in as well as lists of files | |
import csv | |
class CSV_Monster: |
This file contains 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
"""Created by Michael Rosata | |
Python 2.7 | |
Merge together .csv files. I'm creating this because I have 30 .csv files which need to be concatenated. | |
I also have many files which need to be split, so I've added splitting functionality to this as well. | |
""" | |
import csv | |
import sys | |
This file contains 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
<?php | |
ini_set('display_errors', 1); | |
error_reporting(E_ALL); | |
require '../vendor/autoload.php'; | |
define("OAUTH_ACCESS_TOKEN", "the oauth here ya know"); | |
define("OAUTH_ACCESS_TOKEN_SECRET", "put the secret here"); | |
define("CONSUMER_KEY", "key key key key key key"); |
This file contains 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
import Em from 'ember'; | |
const birthdayRE = /\d{4}-\d{2}-\d{2}/; | |
export default Em.Component.extend({ | |
classNames: ['col-md-12', 'section-post-comment'], | |
title: 'Sign-up', | |
/** |
OlderNewer