const groupBy = key => array =>
array.reduce((objectsByKeyValue, obj) => {
const value = obj[key];
objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
return objectsByKeyValue;
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 | |
/** | |
* Plugin Name: Heap WordPress Integration | |
* Plugin URI: https://heapanalytics.com | |
* Description: This plugin adds the Heap snippet to your WordPress site. | |
* Version: 0.1.0 | |
* Author: Heap | |
* Author URI: https://heapanalytics.com | |
* License: GPL | |
*/ |
- Introduction to Ember.js (Luke Melia) https://www.youtube.com/watch?v=7O9X5oeAJm4
- Fire Up with Ember (Sara Robinson) https://www.youtube.com/watch?v=Cs3Fdup7aUo
- Building Web Applications with Ember.js (Yehuda Katz) https://www.youtube.com/watch?v=u6RFyVN9sNg
- Ember.js Guides http://emberjs.com/guides/
- Ember.js Getting Started Guide http://emberjs.com/guides/getting-started/
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
$("#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
<?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
<% [:notice, :error, :alert].each do |level| %> | |
<% unless flash[level].blank? %> | |
<div class="alert-message <%= flash_class(level) %>"> | |
<a class="close" href="#">×</a> | |
<%= content_tag :p, flash[level] %> | |
</div> | |
<% end %> | |
<% end %> |
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
for (var i=1; i <= 20; i++) | |
{ | |
if (i % 15 == 0) | |
console.log("FizzBuzz"); | |
else if (i % 3 == 0) | |
console.log("Fizz"); | |
else if (i % 5 == 0) | |
console.log("Buzz"); | |
else | |
console.log(i); |
NewerOlder