Skip to content

Instantly share code, notes, and snippets.

// Add this to your theme functions.php
function add_additional_rs_code() {
?>
if(window.location.hash.indexOf('video') > -1) {
jQuery('body').scrollTo('.royalSlider');
}
<?php
}
add_action('new_rs_after_js_init_code', 'add_additional_rs_code');
(function() {
var homepage = 'example.com',
url = window.location.href.toLowerCase();
if(url.indexOf(homepage) === -1) {
return;
}
// tracking code...
//function(template, UiClass, items, options)
var self = this;
/**
* Static vars, don't change unless you know what you're doing.
*/
var DOUBLE_TAP_RADIUS = 25,
NUM_HOLDERS = 3;
(function($) {
"use strict";
$.extend($.rsProto, {
_initDeeplinking: function() {
var self = this,
isBlocked,
hashTimeout,
hashChangeTimeout;
Verifying that +dimsemenov is my blockchain ID. https://onename.com/dimsemenov
<?php
$collection = Mage::getModel('review/review')->getCollection()
->addStoreFilter(Mage::app()->getStore()->getId())
->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
->setDateOrder();
$collection->getSelect()
->join(array('attr' => 'catalog_product_entity_int'), 'attr.entity_id = main_table.entity_pk_value', array('*'))
->where('attr.attribute_id = 136')
@dimsemenov
dimsemenov / count-words.js
Created October 21, 2016 08:48
Counts words & sorts them by number of occurences
var fileToTest = grunt.file.read('somefile.js');
var vars = fileToTest.match(/(\w+)/g);
var i = vars.length;
var count;
var parsedVars = [];
var maxWordLen = 3;
while(i--) {
var word = vars[i];
function fire_royalslider_func($atts){
$sliderid = $atts['id'];
$out = '';
if (!$sliderid) return;
/* Print slider HTML, skip this part if you already have it on page */
$out .= get_new_royalslider($sliderid);
/* Print slider END */
// Init code
@dimsemenov
dimsemenov / ba.css
Created October 27, 2017 21:08
Before/After image viewer, will probably create a separate repo for it some day... (c)
img {
margin: 0;
padding: 0;
display: block;
}
.ba-viewer {
overflow: hidden;
position: relative;
width: 100%;