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
#!/bin/bash | |
############################### | |
### Magento Permissions | |
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod o+w var var/.htaccess includes includes/config.php app/etc && chmod 550 pear && sudo find *.sh -type f -exec chmod 755 {} \; | |
rm -rf var/cache/* | |
rm -rf var/session/* |
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 convert($size) | |
{ | |
$unit=array('b','kb','mb','gb','tb','pb'); | |
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i]; | |
} | |
convert(memory_get_usage()); |
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 | |
// @author : https://gist.github.com/mehdichaouch | |
/** BEGIN DEV ****************************/ | |
try { | |
$clientIp = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : ''; | |
$teamIp = array( | |
'10.71.3.17', //mehcha | |
'YOUR IP', |
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 | |
/** Configuration **/ | |
ini_set('display_errors', 1); | |
ini_set('error_reporting', E_ALL); | |
ini_set('max_execution_time', 24*3600); // 1800 secondes = 30 minutes | |
ini_set('memory_limit', '4096M'); | |
/** Set $path with the path of your Magento install **/ | |
$path = realpath(dirname(__FILE__) . '/../../'); | |
set_include_path(get_include_path() . PATH_SEPARATOR . $path); |
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
walk(document.body); | |
setTimeout(function() { | |
walk(document.body); | |
}, 1000); | |
function walk(node) | |
{ | |
// Source: http://is.gd/mwZp7E | |
var child, next; |
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
#!/bin/bash | |
find ./var/cache/* -not \( -path "./var/cache/sessions" -prune \) -exec rm -rf {} \; |
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 | |
$product = $this->getProduct(); | |
// return no link in case of zero night | |
if (is_null($product->getData('nights'))) { | |
return '#'; | |
} | |
$language = Mage::getStoreConfig('general/locale/code'); | |
$country = $dcsInfo->getData('country'); |
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
(function(){s=document.getElementsByClassName('search_bar__form__input');s[0]?window.open('https://google.com/#q='+s[0].value,'_parent'):alert('You are not on Qwant page dude!')})(); |
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
(function(){var doc=document;var text=doc.getElementsByClassName('issue-table-container')[0];if(doc.body.createTextRange){/* ms */var range=doc.body.createTextRange();range.moveToElementText(text);range.select();}else if(window.getSelection){/* moz, opera, webkit */var selection=window.getSelection();var range=doc.createRange();range.selectNodeContents(text);selection.removeAllRanges();selection.addRange(range);}})(); |