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
def start_and_end_dates_from_week_number(number) | |
end_time = Time.now.at_beginning_of_year.utc + (number).weeks | |
((end_time-1.week)..end_time) | |
end |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>jQuery Progress Bars</title> | |
<script src="http://code.jquery.com/jquery-1.4.4.min.js" type="text/javascript"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(document).ready(function(){ | |
$(".progress-bar").each(function(){ |
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/ruby | |
# strips anchor text from $stdin | |
# usage | |
# cat links.txt | ruby /usr/bin/link_parser | |
# Fetch input and strip anchor text. | |
while line = $stdin.gets do | |
puts line.to_s.gsub(/<a[^>]*>|<\/a>/,'') | |
end |
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 bash | |
sudo CFLAGS='-arch i386' CCFLAGS='-arch i386' CXXFLAGS='-arch i386' sudo ./configure --prefix=/usr/local --with-apxs2=/usr/sbin/apxs --with-ldap=/usr --with-kerberos=/usr --enable-cli --with-zlib-dir=/usr --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-sockets --with-iodbc=/usr --with-curl=/usr --with-config-file-path=/etc --sysconfdir=/private/etc --with-mysql-sock=/var/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql --with-openssl=/usr --with-xmlrpc --with-xsl=/usr --without-pear --with-libxml-dir=/usr --with-iconv=/usr/local --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --with-gd --with-jpeg-dir=/opt/local --with-png-dir=/opt/local --with-freetype-dir=/opt/local --with-mcrypt=/opt/local; | |
sudo make; | |
sudo make install; |
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
<?xml version="1.0"?> | |
<config> | |
<modules> | |
<Mezzmer_HomeTryOn> | |
<version>1.0.0</version> | |
</Mezzmer_HomeTryOn> | |
</modules> | |
<global> | |
<blocks> | |
<!-- Block Section --> |
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
$j("img.women").hide(); // Hide Women Class Images | |
$j("img.men").hide(); // Hide Men Class Images |
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'> | |
$j(document).ready(function(){ | |
<?php | |
if( isset( Mage::registry('current_category')->getName() )){ | |
echo strtolower( Mage::registry('current_category')->getName() ) == 'mens' ? "$j('img.womens').hide();" : "$j('img.mens').hide();"; | |
} | |
?> | |
}); | |
</script> |
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
select donations.organization, (sum(orders.grand_total) * (3 / 100)) from sales_flat_order as orders | |
inner join donations on donations.order_id = orders.increment_id | |
where orders.created_at between adddate(curdate(), interval -30 day) | |
and curdate() | |
group by donations.organization; |
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 file is part of the OpenWISP User Management System | |
# | |
# Copyright (C) 2010 CASPUR (wifi@caspur.it) | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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
# simple method to allow you to underscore all keys in a hash | |
class Hash | |
def underscore | |
self.each_key{ |k| self[k.to_s.underscore] = self[k]; self.delete(k) } | |
end | |
end |