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
$words = ['кит', 'кот', 'тик', 'кти', 'ток', 'ков']; | |
$hash = []; | |
foreach($words as $word) { | |
$lowerWord = strtolower($word); | |
$wordArray = preg_split('//u', $lowerWord, null, PREG_SPLIT_NO_EMPTY); | |
sort($wordArray); | |
$sorted = implode('',$wordArray); | |
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
<template name="wa-fields" value="<div class="block fields"> <div class="field-group"> <div class="field"> <div class="name"></div> <div class="value"></div> </div> </div> <div class="field-group"> <div class="field"> <div class="value"> <input type="button" class="button" value="Save" /> </div> </div> </div> </div>" description="fields" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
<option name="PHP" value="true" /> | |
<option name="Twig" value="true" /> | |
<option name="Vue" value="true" /> | |
</context> | |
</template> | |
<template name="wa-form-field" value="<div class="field"> |
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
/** | |
* var long = $.wa.kmLongAction(); | |
* long.start({ | |
process_url: 'url_to_walongaction_controller', | |
start: { | |
data: { id: some_id } | |
} | |
}); | |
*/ | |
(function ($) { |
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
// source https://github.com/medius/utm_form | |
var UtmCookie;UtmCookie=function(){function e(e){null==e&&(e={}),this._cookieNamePrefix="_uc_",this._domain=e.domain,this._sessionLength=e.sessionLength||1,this._cookieExpiryDays=e.cookieExpiryDays||365,this._additionalParams=e.additionalParams||[],this._utmParams=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],this.writeInitialReferrer(),this.writeLastReferrer(),this.writeInitialLandingPageUrl(),this.setCurrentSession(),this.additionalParamsPresentInUrl()&&this.writeAdditionalParams(),this.utmPresentInUrl()&&this.writeUtmCookieFromParams()}return e.prototype.createCookie=function(e,t,i,r,o,a){var n,s,l,m,d,u;u=null,i&&(d=new Date,d.setTime(d.getTime()+24*i*60*60*1e3),u=d),s=null!=u?"; expires="+u.toGMTString():"",l=null!=r?"; path="+r:"; path=/",n=null!=o?"; domain="+o:"",m=null!=a?"; secure":"",document.cookie=this._cookieNamePrefix+e+"="+escape(t)+s+l+n+m},e.prototype.readCookie=function(e,t){var i,r,o,a;for(t=t||!1,a=t?e+"=":this._cookieName |
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 | |
var_dump(gaSendRefund('2642236223')); | |
function gaSendRefund($transaction_id) | |
{ | |
$url = 'https://www.google-analytics.com/collect'; | |
$tid = 'UA-XXXXXXX-X'; | |
$params = http_build_query( | |
array( |
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
// Countdown section | |
var $countdown_section = $('<section class="clearfix" style="padding: 50px 0;">' + | |
'<div class="row">' + | |
' <div class="col-sm-8" style="padding-top: 17px;">' + | |
' <div class="col-sm-6 col-md-3 text text-center" style="padding: 0;">Order within</div>' + | |
' <div class="col-sm-6 col-md-3 countdown" style="padding: 0;"></div>' + | |
' <div class="col-md-6 text text-center" style="padding: 0;">for delivery by <span class="delivery-date"></span></div>' + | |
' </div>' + | |
' <div class="col-sm-4 buy-btn"></div>' + | |
'</div>' + |
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
// Add new reviews slider: | |
// html wrapper + buttons, | |
// right/left button click handler, | |
// recalculate banner`s buttons position after each slide | |
$('<div class="reviews-title">').css({ | |
'padding': '0 25px 10px' | |
}).append($happy_clients.icon, $happy_clients.text).insertBefore($new_reviews_wrapper); | |
$new_reviews_wrapper.find('div.all_reviews').css({ | |
'width': reviews.length * review_width, |
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
//vwo_$ = jQuery; | |
vwo_$(document).ready(function(){ | |
var $secure_site = vwo_$('img[src="../Images/SecureSite.jpg"]').closest('td'), | |
$title_wrapper = vwo_$('.cont_heading_td'), | |
$geotrust_wrapper = $title_wrapper.siblings().contents().css({ | |
'display': 'inline-block', | |
'vertical-align': 'middle', | |
'width': '35%' | |
}), | |
$info_footer_column = vwo_$('td:contains(INFO):last').closest('table'), |
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 | |
// Thanks to: http://www.sitepoint.com/forums/showthread.php?708194-Is-it-possible-to-round-up-date()-or-strtotime()-to-nearest-hour&s=086875bf39a87d999fd9db47ac69bcf0&p=4720952&viewfull=1#post4720952 | |
// php >= 5.3 | |
$date = '2014-04-01 18:30:00'; | |
$datetime = DateTime::createFromFormat('Y-m-d H:??:??', $date); | |
$start = $datetime->format('g A'); | |
$end = $datetime->modify('next hour')->format('g A'); |
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 | |
class Place | |
{ | |
protected $begin; | |
protected $end; | |
protected $name; | |
protected $description; | |
function __construct($begin, $end, $name, $description) |
NewerOlder