Skip to content

Instantly share code, notes, and snippets.


Yogendra Kumar mssyogi

View GitHub Profile
mssyogi / server.js
Created Mar 18, 2020
View server.js
const express = require('express');
const fs = require('fs');
const path = require('path');
const cors = require('cors');
const compression = require('compression');
const helmet = require('helmet');
const morgan = require('morgan');
const Routes = require('./routes');
const Database = require('./database');
const logger = require('./config/logger');
mssyogi / image zoom used in magento2
Created Feb 27, 2018
image zoom used in magento2
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;
mssyogi / convert.php
Created Dec 20, 2017 — forked from nbriz/convert.php
convert image into base64 encoded string
View convert.php
<!DOCTYPE html>
<title> img to data</title>
<meta charset="utf-8">
textarea{ width: 50%; height: 200px; }
mssyogi / MultiPartFromStrings.php
Created Nov 27, 2017 — forked from iansltx/MultiPartFromStrings.php
Multipart file uploads in PHP from strings
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.
mssyogi / solrconfig.xml
Created Jun 2, 2016 — forked from arunchinnachamy/solrconfig.xml
Default SOLR Configuration file solrconfig.xml
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
mssyogi / Narno_Mage_Extension.php
Created Mar 21, 2016 — forked from Narno/Narno_Mage_Extension.php
Get download link of a Magento extension from MagentoConnect key.
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;
mssyogi / gist:172c5d56064ca901e921
Created Nov 21, 2015 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
View gist:172c5d56064ca901e921
// API access key from Google API's Console
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
You can’t perform that action at this time.