Skip to content

Instantly share code, notes, and snippets.

View srinathweb's full-sized avatar

srinath madusanka srinathweb

View GitHub Profile
@srinathweb
srinathweb / magento-code-snippets.md
Created December 8, 2015 15:29 — forked from arosenhagen/magento-code-snippets.md
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@srinathweb
srinathweb / opencart external
Created November 6, 2015 05:06
opencart external
How do I add a product to OpenCart from an external site?
up vote
0
down vote
favorite
I need to add a product to the shopping cart from a website to ocart. I was trying the following code. All I get is "shopping cart empty" after the user clicks the submit button.
@srinathweb
srinathweb / rotete
Created November 5, 2015 04:41
rotate
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand');
-moz-transform: matrix(0.00000000, -1.00000000, 1.00000000, 0.00000000, 0, 0);
-webkit-transform: matrix(0.00000000, -1.00000000, 1.00000000, 0.00000000, 0, 0);
-o-transform: matrix(0.00000000, -1.00000000, 1.00000000, 0.00000000, 0, 0);
http://stackoverflow.com/questions/11900870/rotating-a-text-to-270-degrees-in-ie8
@srinathweb
srinathweb / iframe width
Created November 4, 2015 10:34
iframe width
Add this to your <head> section
<script language="javascript" type="text/javascript">
function resizeIframe(obj) {
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}
</script>
And change your iframe to this:
@srinathweb
srinathweb / download_and_upload.php
Created October 28, 2015 10:19 — forked from joseporiol/download_and_upload.php
Just Download & save a remote image on your server using PHP
$image = file_get_contents('http://www.url.com/image.jpg');
file_put_contents('/images/image.jpg', $image); //save the image on your server
@srinathweb
srinathweb / url hash
Created October 22, 2015 12:15
url hash
if(window.location.hash) {
// Fragment exists
} else {
// Fragment doesn't exist
}
@srinathweb
srinathweb / recover position fixed issue opera
Created October 22, 2015 11:00
recover position fixed width issue opera
.menufixed{
position: fixed;
top: 0;
z-index: 999;
margin: 0 auto;
width: 100%;
background: #fff;
left: 50%;
transform: translateX(-50%);
@srinathweb
srinathweb / bootsrap solution
Created October 22, 2015 08:33
bootsap solution
@media (min-width: 1200px) {
.container{
max-width: 970px;
}
}
@srinathweb
srinathweb / load more
Created October 22, 2015 03:34
load more
Have you heard about the jQuery Waypoint plugin.
Below is the simple way of calling a waypoints plugin and having the page load more Content once you reaches the bottom on scroll :
$(document).ready(function() {
var $loading = $("<div class='loading'><p>Loading more items&hellip;</p></div>"),
$footer = $('footer'),
opts = {
@srinathweb
srinathweb / Reload the page after ajax success
Created October 21, 2015 09:03
Reload the page after ajax success
$(document).ajaxStop(function(){
setTimeout("window.location = 'otherpage.html'",100);
});