This file contains hidden or 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
http://angularjschicago.github.io/angular-tips-and-tricks | |
http://www.egghead.io | |
http://www.thinkster.io | |
http://briantford.com/blog/huuuuuge-angular-apps.html |
This file contains hidden or 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
$("#frmButtons\\:btnExportWord").click(function (e) { | |
//track the event | |
_gaq.push(['_trackEvent', 'Decode', 'Decode copying', 'Export to Word']); | |
var button = $(this); | |
//create a delay and call the same click | |
if (button.data('tracked') != 'true') { | |
e.preventDefault(); //consume event if not tracked yet | |
setTimeout( function(){ | |
button.data('tracked', 'true'); |
This file contains hidden or 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
<table id="daysoftheweek"> | |
<tr> | |
<th>Sun</th> | |
<th>Mon</th> | |
<th>Tue</th> | |
<th>Wed</th> | |
<th>Thu</th> | |
<th>Fri</th> | |
<th>Sat</th> | |
</tr> |
This file contains hidden or 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(window).ready(slideshowResize); | |
jQuery(window).resize(slideshowResize); | |
//function to resize and center images and slideshow | |
function slideshowResize() { | |
//SET CUSTOM VARIABLES | |
//set ratio value by dividing the images width by it height | |
//* I usually round this to 2 decmials | |
var imageRatio = "1.75"; | |
//set containerName equal to the div containing the image or slideshow function will use this div to set height and width so use 100% width or height for responsive demensions |
This file contains hidden or 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
# Avoid annoying ActionController::UnknownHttpMethod exceptions like: | |
# | |
# ActionController::UnknownHttpMethod) "CONNECT, accepted HTTP methods are get, head, put, post, delete, and options" | |
# | |
# Install this file in app/metal and these requests will receive a 405 | |
# "Method Not Allowed" status and will be logged under `info'. | |
class IgnoreUnknownHttpMethod | |
def self.call(env) | |
[ | |
if ActionController::Request::HTTP_METHODS.include?(env["REQUEST_METHOD"].downcase) |
This file contains hidden or 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> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>jeditable + bootstrap datepicker custom type demo</title> | |
<link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css"> | |
<link rel="stylesheet" type="text/css" href="https://raw.github.com/eternicode/bootstrap-datepicker/master/css/datepicker.css"> | |
</head> | |
<body> |
This file contains hidden or 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 | |
function display_dynamic_pricing_table(){ | |
global $post; | |
# see line 42 of woocommerce_pricing_by_product.class.php | |
$pricing_rule_sets = get_option('_a_category_pricing_rules', array()); | |
$found = false; | |
if(count($pricing_rule_sets)){ | |
global $woocommerce_pricing; | |
foreach ($pricing_rule_sets as $pricing_rule_set) { |
This file contains hidden or 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 | |
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php | |
/** | |
* The root directory where the repos live. | |
* | |
* @var string | |
*/ | |
$root_dir = '/your/root/dir/'; |
This file contains hidden or 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 | |
//a simple script to check user agents to detemine device type and or redirect | |
//============================================== | |
//get userangent string | |
$userAgentraw = $_SERVER['HTTP_USER_AGENT']; | |
//convert to lowercase to make search strings simplier | |
$userAgent = strtolower ( $userAgentraw ); |
This file contains hidden or 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
//Load | |
yepnope([ | |
{ | |
load: [ | |
'//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', | |
'//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js', | |
'//cdnjs.cloudflare.com/ajax/libs/raphael/1.5.2/raphael-min.js' | |
], | |
complete: function(){ |
OlderNewer