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
/*ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f8907182ef665ac560d2043d7dee9ac1f89071 |
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/env ruby | |
# A script to setup a PHP dev. environment on a local MacOSX 10.6.8+ machine | |
require 'optparse' | |
# This hash will hold all of the options | |
# parsed from the command-line by | |
# OptionParser. | |
options = {} | |
optparse = OptionParser.new do |opts| |
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
<ol> | |
<?php foreach ($this->getItems() as $_item): ?> | |
<li> | |
<?php if ($_item->getCount() > 0): ?> | |
// Add attribute option image before label | |
<?php if($_item->getName() == "Color") : ?> | |
<img src="<?php echo Mage::helper('attributeoptionimage')->getAttributeOptionImage($_item->getValue()); ?>" alt="" /> | |
<?php endif; ?> | |
<a href="<?php echo $this->urlEscape($_item->getUrl()) ?>"><?php echo $_item->getLabel() ?></a> | |
<?php else: echo $_item->getLabel() ?> |
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
/*! | |
* jQuery lightweight plugin boilerplate | |
* Original author: @ajpiano | |
* Further changes, comments: @addyosmani | |
* Licensed under the MIT license | |
*/ | |
// the semi-colon before the function invocation is a safety | |
// net against concatenated scripts and/or other plugins |
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 modified snippet is from a function that accepts the current month(currentmonth) and period(period) and adds the period to the current month and lists every month within the new period. It can accept negative or positive periods. | |
function iterveningMonths(year, month, period) { | |
var movement = period < 0 ? -1 : 1; //Which way are we going? | |
var out = []; | |
var result; | |
for (var i = Math.abs(period); i !== 0; i--) { | |
month += movement; //Increment or decrement month | |
result = month % 12; //Check to see where that month is on a 12 month[0..11] period |
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
// How to refactor this bitch? | |
var dateCompare = function(date1, date2, operator) { | |
if(operator === ">") return date1.getTime() > date2.getTime(); | |
if(operator === "<") return date1.getTime() < date2.getTime(); | |
if(operator === "==") return date1.getTime() == date2.getTime(); | |
//And so on and so forth with the other operators (>=, <=) | |
} | |
// Different approach but moves the conditional logic out |
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
<script type="text/javascript" src="statics/js/jquery.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('#fire').click(function() { // This event fires when a button is clicked | |
var obj = $('#inputext').val(); | |
$.ajax({ // ajax call starts | |
url: '/activity/', // JQuery loads serverside | |
data: 'obj=' + obj, // Send value of the clicked button | |
dataType: 'json', // Choosing a JSON datatype | |
success: function(data) // Variable data contains the data we get from serverside |
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
// Version: v1.0.0-pre.2-378-g2e2b4ec | |
// Last commit: 2e2b4ec (2013-01-12 15:56:53 -0800) | |
(function() { | |
/*global __fail__*/ | |
/** | |
Ember Debug |
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
// Version: v1.0.0-pre.2-291-g0bec74f | |
// Last commit: 0bec74f (2013-01-05 12:03:02 -0600) | |
(function() { | |
/*global __fail__*/ | |
/** | |
Ember Debug |
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
// Version: v1.0.0-pre.2-347-gf187ea8 | |
// Last commit: f187ea8 (2013-01-09 16:25:00 -0800) | |
(function() { | |
/*global __fail__*/ | |
/** | |
Ember Debug |
OlderNewer