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 |
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
# Create project | |
phonegap create path/to/project my.project.id ProjectName | |
# Add specific platform | |
phonegap local build platformName | |
# Add plugin | |
phonegap local plugin add RemotePathToPlugin | |
# Remove plugin |
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
rateApp = -> | |
# Use iTunes link maker http://itunes.apple.com/linkmaker/ to get the real direct link | |
rate_app_counter = parseInt window.localStorage.getItem("rate_app_counter") or 0 | |
rate_app = parseInt window.localStorage.getItem("rate_app") or 1 | |
rate_count_max = 3 | |
app_id_ios = "123456789" | |
app_id_android = "com.company.YourAppID" | |
app_id_blackberry = "123456789" | |
rate = (buttonIndex) -> |
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
MODULE_NOT_FOUND = 1 | |
check_module = (module) -> | |
try | |
require.resolve module | |
catch e | |
process.stderr.write "ERROR: #{module} is not found. Please install it first.\n" | |
process.exit MODULE_NOT_FOUND | |
fs = require 'fs' | |
{print} = require 'sys' |
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
{ | |
"id":0, | |
"title":"", | |
"width":100, | |
"height":100, | |
"background-color":"FFF", | |
"background-image":"", | |
"background-repeat":"no-repeat | repeat | repeat-x | repeat-y", | |
"frames": | |
[ |
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
String::hash = -> | |
userNumber = @length | |
for i in @ | |
char = @charCodeAt i | |
userNumber += char | |
(userNumber + Math.floor(userNumber * 1e15)).toString(32).toUpperCase() |
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
ProcessDocument = app.trustedFunction(function () { | |
app.beginPriv(); | |
var newDoc = app.newDoc(); | |
var p = app.response("Start with page(default 0 - process all pages)?", "Query", "0"); | |
var startFrom = parseInt(p) || 0; | |
var i = 0; | |
while (i < this.numPages) { | |
newDoc.insertPages({ | |
nPage: newDoc.numPages - 1, |
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 | |
function parseFavicon($html) { | |
// Get the 'href' attribute value in a <link rel="icon" ... /> | |
// Also works for IE style: <link rel="shortcut icon" href="http://www.example.com/myicon.ico" /> | |
// And for iOS style: <link rel="apple-touch-icon" href="somepath/image.ico"> | |
$matches = array(); | |
// Search for <link rel="icon" type="image/png" href="http://example.com/icon.png" /> | |
preg_match('/<link.*?rel=("|\').*icon("|\').*?href=("|\')(.*?)("|\')/i', $html, $matches); | |
if (count($matches) > 4) { |
OlderNewer