Skip to content

Instantly share code, notes, and snippets.

View Viktorminator's full-sized avatar

Viktor Matushevskyi Viktorminator

View GitHub Profile
@Viktorminator
Viktorminator / docker-commands.txt
Last active September 2, 2020 12:14
docker-commands
λ docker run --name rabbitmq rabbitmq:3
λ docker run -it --rm --name rabbitmq-management -p 5672:5672 -p 15672:15672 rabbitmq:3-management
git checkout beta
# rename master to alpha
git push origin :master alpha
# delete master locally
git branch -D master
# rename live to master
git push origin :live master
@Viktorminator
Viktorminator / user_aliases.cmd
Created February 21, 2019 12:59
Viktor's cmder aliases
;= @echo off
;= rem Call DOSKEY and use this file as the macrofile
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0%
;= rem In batch mode, jump to the end of the file
;= goto:eof
;= Add aliases below here
e.=explorer .
p.=phpstorm .
gs=git status
gaa=git add .
@Viktorminator
Viktorminator / user_aliases.cmd
Last active February 17, 2019 09:48
Cmder aliases
;= @echo off
;= rem Call DOSKEY and use this file as the macrofile
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0%
;= rem In batch mode, jump to the end of the file
;= goto:eof
;= Add aliases below here
e.=explorer .
gl=git log --oneline --all --graph --decorate $*
ls=ls --show-control-chars -F --color $*
pwd=cd
@Viktorminator
Viktorminator / summ.js
Created October 17, 2016 19:22
Sum without highest and lowest number
const sumArray = arr => ((arr == null) || (arr.length < 2)) ? 0 : arr.reduce((a, b) => a + b, 0) - Math.max(...arr) - Math.min(...arr);
@Viktorminator
Viktorminator / remove.js
Created October 17, 2016 18:41
Exclamation marks series #2: Remove all exclamation marks from the end of sentence
function remove(s){
return s.replace(/!+$/, '')
}
@Viktorminator
Viktorminator / remove.js
Created October 15, 2016 20:41
Exclamation marks series #3: Remove all exclamation marks from sentence except at the end
function remove(s){
return s.replace(/!+([^!])/g, '$1')
}
@Viktorminator
Viktorminator / remove.js
Created October 14, 2016 09:52
Exclamation marks series #1: Remove a exclamation mark from the end of string
function remove(s){
return (s.slice(-1) == '!') ? s.substring(0, s.length - 1) : s;
}
$(document).ready(function() {
function getCookie(name) {
var matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
var cookie = getCookie('view_banner');
<?php
//$input = '44.60855718,33.5143017';
if (!($input)) $output = '';
$someshit = explode(',', $input);
$someshit = array_reverse($someshit);
$mystring = implode('%2C', $someshit);
// echo $mystring;
$output = '<script src="http://panoramas.api-maps.yandex.ru/embed/1.x/?lang=ru_UA&l=stv&ll=' . $mystring .'&ost=dir%3A36.6150270900669%2C0~spn%3A89.99999987427145%2C39.71042873864211&size=450%2C400"></script>';
return $output;