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
var productsBottomOffset = $('#products-end')[0].getBoundingClientRect().top - document.body.getBoundingClientRect().top; | |
//var productsBottomOffset = $('#products-end').offset().top; | |
//var productsBottomOffset = $('#products-end').position().top; | |
// jquery offset and position works unreliable. can't figure why for desktop position() is correct but for mobile offset() |
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
system/codeIgniter/CodeIgniter.php | |
hack inside CodeIgniter.php | |
after controller call just return to test without destructors and etc | |
<?php | |
call_user_func_array(array(&$CI, $method), array_slice($RTR->rsegments, (($RTR->fetch_directory() == '') ? 2 : 3))); | |
if (defined('UnitTest')) return; |
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 | |
use Magento\Framework\App\Bootstrap; | |
include('app/bootstrap.php'); | |
$bootstrap = Bootstrap::create(BP, $_SERVER); | |
$objectManager = $bootstrap->getObjectManager(); | |
$state = $objectManager->get('Magento\Framework\App\State'); | |
$state->setAreaCode('frontend'); |
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 inject($file) { | |
echo $file."\n"; | |
$pattern = 'type="text/x-magento-init"'; | |
$patternNew = 'type="text/x-magento-init" lovethis="'.md5($file).'"'; | |
$s = file_get_contents($file); | |
$s = str_replace($pattern,$patternNew,$s); | |
file_put_contents($file, $s); |
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
function uploadFile(file) { | |
var formData = new FormData(); | |
formData.append("userfile", file); | |
var request = new XMLHttpRequest(); | |
request.onload = function () { | |
if (request.status == 200) { | |
document.location.href='/'; | |
} else { | |
alert('Error! Upload failed'); | |
} |
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
((t, n, r) -> | |
i = typeof require == 'function' and require | |
s = (o, u) -> | |
if !n[o] | |
if !t[o] | |
a = typeof require == 'function' and require | |
if !u and a | |
return a(o, !0) | |
if i |
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
CTRL+D in Notepad++ just means "Duplicate current line". | |
I don't believe there's an equivalent in DW. | |
Perhaps use Autohotkey (or alike) to create a macro that moves to the start of the line, then selects to the end of the line, then inserts a blank line below, and then inserts your copied line: | |
Then bind that to CTRL+D (or whatever). |
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
cdandclear_search() { | |
if [[ -n $7 ]]; then | |
find . -maxdepth $MAXDEPTH -type d | grep -i $1 | grep -i $2 | grep -i $3 | grep -i $4 | grep -i $5 | grep -i $6 | grep -i $7 | tee /tmp/cdfind | egrep -i "$1|$2|$3|$4|$5|$6|$7" | |
elif [[ -n $6 ]]; then | |
find . -maxdepth $MAXDEPTH -type d | grep -i $1 | grep -i $2 | grep -i $3 | grep -i $4 | grep -i $5 | grep -i $6 | tee /tmp/cdfind | egrep -i "$1|$2|$3|$4|$5|$6" | |
elif [[ -n $5 ]]; then | |
find . -maxdepth $MAXDEPTH -type d | grep -i $1 | grep -i $2 | grep -i $3 | grep -i $4 | grep -i $5 | tee /tmp/cdfind | egrep -i "$1|$2|$3|$4|$5" | |
elif [[ -n $4 ]]; then | |
find . -maxdepth $MAXDEPTH -type d | grep -i $1 | grep -i $2 | grep -i $3 | grep -i $4 | tee /tmp/cdfind | egrep -i "$1|$2|$3|$4" | |
elif [[ -n $3 ]]; then |
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
mgvg() { | |
a='$a' | |
ag='ag -l' | |
xa='xargs -d "\n"' | |
xai='xargs -d "\n" -I{}' | |
dollar='$' | |
n='"\n"'; | |
q="\'" | |
wq='"' | |
zero='0' |
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
mgv() { | |
a='$a' | |
ag='ag -l' | |
xa='xargs -d "\n"' | |
n='"\n"'; | |
q="\'" | |
p="$a=explode(' ','$@'); \ | |
echo '$ag '.implode(' | $xa $ag ',$a).$n; \ | |
echo ' | $xa ag $q'.implode('|',$a).'$q';" | |
#echo $p |