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
<link rel="import" href="../paper-button/paper-button.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
#paper_button { | |
left: 310px; | |
top: 110px; | |
position: relative; |
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
<link rel="import" href="../components/polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
</template> | |
<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
<?php | |
$applesharedsecret = "XXXXXXXXXXX"; | |
$receiptbytes = $_POST['receiptbytes']; | |
//$appleurl = "https://buy.itunes.apple.com/verifyReceipt"; // for production | |
$appleurl = "https://sandbox.itunes.apple.com/verifyReceipt"; // for testing | |
$request = json_encode(array("receipt-data" => $receiptbytes,"password"=>$applesharedsecret)); | |
$ch = curl_init($appleurl); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_POST, true); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $request); |
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
(navigator.userAgent).match(/OS\s+([\d\_]+)/i)[0].replace(/_/g, '.').replace('OS ', '') |
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
"#" + ((1<<24)*Math.random()|0).toString(16) |
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
// 5 columns layout for bootstrap | |
.col-xs-2_4, | |
.col-sm-2_4, | |
.col-md-2_4, | |
.col-lg-2_4 | |
position: relative | |
min-height: 1px | |
padding-right: 10px | |
padding-left: 10px |
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
# a fragment of 3-rd party grid component | |
class AwesomeGrid | |
constructor: (@datasource)-> | |
@sort_order = 'ASC' | |
@sorter = new NullSorter # in this place we use NullObject pattern (another useful pattern) | |
setCustomSorter: (@customSorter) -> | |
@sorter = customSorter | |
sort: () -> | |
@datasource = @sorter.sort @datasource, @sort_order | |
# don't forget to change sort order |
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
<?php | |
$memory = round(memory_get_usage()/1024/1024, 4).' Mb'; | |
print "<div>Memory: {$memory}</div>"; | |
$totalTime= ($modx->getMicroTime() - $modx->startTime); | |
$queryTime= $modx->queryTime; | |
$queryTime= sprintf("%2.4f s", $queryTime); | |
$queries= isset ($modx->executedQueries) ? $modx->executedQueries : 0; | |
$totalTime= sprintf("%2.4f s", $totalTime); |
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
<?php | |
/** | |
* @package modx | |
* @subpackage processors.element.tv.renders.mgr.input | |
* | |
* core/model/modx/processors/element/tv/renders/mgr/input/gmaps.class.php | |
*/ | |
class modTemplateVarInputRenderGmaps extends modTemplateVarInputRender { | |
public function getTemplate() { | |
return 'element/tv/renders/input/gmaps.tpl'; |
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
# FIX for Bootstrap and Google Maps Info window styes problem | |
css = document.createElement 'style' | |
css.type = 'text/css' | |
styles = 'img[src*="gstatic.com/"], img[src*="googleapis.com/"] { max-width: none; }' | |
if css.styleSheet | |
css.styleSheet.cssText = styles | |
else | |
css.appendChild(document.createTextNode styles) | |
document.getElementsByTagName("head")[0].appendChild css |
OlderNewer