Skip to content

Instantly share code, notes, and snippets.

View ivanovcodes's full-sized avatar

Vladimir V. Ivanov ivanovcodes

  • Private Company
  • Singularly
View GitHub Profile
@ivanovcodes
ivanovcodes / gist:2c3cf2d1012357e51de8a65c328d24bb
Last active November 20, 2018 14:59
Полный JSON отправки заказа в 1С
{
"collection": {
"orders": {
"1": {
"id": "1",
"number": "НФНФ-000002",
"created": "2018-11-19 15:53:09",
"updated": "2018-11-20 16:00:00",
"price": 5000.00,
"discount": 10,
@ivanovcodes
ivanovcodes / relink
Last active October 26, 2017 08:05
relink
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RewriteCond %{HTTP_REFERER} !^http:\/\/(www\.)?site\.ru\/m\/(index.php)?$
RewriteRule ^$ http://domain.com/m/ [L,R=302]
</IfModule>
@ivanovcodes
ivanovcodes / geo
Last active August 16, 2017 12:45
Snippet insert the geocity on the page
<script src='//api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU' type='text/javascript'></script>
<script>window.onload=function(){var n=document.getElementsByClassName('user-city');[].forEach.call(n,function(n){n.innerText=ymaps.geolocation.city})};</script>
I'am from <span class='user-city'></span>, <span class='user-city'></span> never sleep!
<script type="text/javascript" src="https://yastatic.net/jquery/3.1.0/jquery.min.js"></script>
<script>var jquery_3_1_0 = jQuery;</script>
<script type="text/javascript">
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';