Instantly share code, notes, and snippets.

View image zoom used in magento2
<!-- fotorama.css & fotorama.js. -->
<link href="" rel="stylesheet"> <!-- 3 KB -->
<script src=""></script> <!-- 16 KB -->
<!-- 2. Add images to <div class="fotorama"></div>. -->
<div class="fotorama" data-allowfullscreen="true" data-fit="scaledown" data-nav="thumbs">
<img src="">
<img src="">
View gist:db8dd1202b3f80973900badb248b3c94
* COS(RADIANS(lng) - RADIANS(@lng))
+ SIN(RADIANS(@lat))
* SIN(RADIANS(lat))))
AS distance_in_km
FROM airports
ORDER BY distance_in_km ASC
LIMIT 0,5;
View gist:0a1065d889beb8662a98740e976add4a
<script type="text/javascript">
var ov = $(this).val();
// console.log(ov);
var nv='';
var tags = ov.split(",");
var i=-1;
View gist:75619f46e45952a659b1a724428a4d9c
$r = $_REQUEST['r'];
$root = getcwd();
if ($r == "flushcache") {
$cl = "php ". $root."/../n98-magerun2.phar cache:flush";
$results = shell_exec($cl);
echo $results;
View convert.php
<!DOCTYPE html>
<title> img to data</title>
<meta charset="utf-8">
textarea{ width: 50%; height: 200px; }
View MultiPartFromStrings.php
* PHP's curl extension won't let you pass in strings as multipart file upload bodies; you
* have to direct it at an existing file (either with deprecated @ syntax or the CURLFile
* type). You can use php://temp to get around this for one file, but if you want to upload
* multiple files then you've got a bit more work.
* This function manually constructs the multipart request body from strings and injects it
* into the supplied curl handle, with no need to touch the file system.
View solrconfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
View Narno_Mage_Extension.php
* Get download link of a Magento extension from MagentoConnect key
* Dependencies: Zend_Http_Client, Zend_Uri (Zend Framework)
class Narno_Mage_Extension
protected $_key = null;
View gist:172c5d56064ca901e921
// API access key from Google API's Console
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array


A simple d3.js slider