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
/** | |
* 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
<?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', | |
/** |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
isDisabled: false, | |
pureBoolean: Em.computed('isDisabled', function() { | |
return !this.get('isDisabled'); | |
}), | |
actions: { | |
makeDisabled() { |
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 Ember from "ember"; | |
export default Ember.Helper.helper(function([content, group, contentGroupKey]) { | |
return content.filterBy(contentGroupKey, group); | |
}); |
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
/** | |
* Ember | |
* (more functional style) Getter and Setter | |
* | |
* setup option 1 (modular): | |
* const {get, set} = getSetterDecorator(); | |
* setup option 2 (global): | |
* getSetterDecorator( window ); | |
*/ | |
import Ember from 'ember'; |
OlderNewer