Skip to content

Instantly share code, notes, and snippets.

View Viktorminator's full-sized avatar

Viktor Matushevskyi Viktorminator

View GitHub Profile
@Viktorminator
Viktorminator / showtopstar.php
Created October 1, 2012 17:27
MODX Revolution Star Rating top star elements
<?php
$snippetPath = $modx->getOption('core_path').'components/star_rating/';
$modx->addPackage('star_rating',$snippetPath.'model/');
$c = $modx->newQuery('starRating');
$c->sortby('vote_total','DESC');
$c->sortby('vote_count','DESC');
$c->limit('100');
$c->prepare();
$c->stmt->execute();
$res = $c->stmt->fetchAll(PDO::FETCH_ASSOC);
@Viktorminator
Viktorminator / Preferences.sublime-settings
Created October 31, 2013 21:55
Preferences.sublime-settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"draw_indent_guides": true,
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".git",
@Viktorminator
Viktorminator / seo-meta-tags.html
Last active March 11, 2016 12:21
SEO META for FB and Twitter
<meta property="article:publisher" content="https://www.facebook.com/facebookpage" />
<meta property="article:tag" content="some tag content" />
<meta property="article:section" content="some section" />
<meta property="article:published_time" content="2013-05-08T12:00:59+00:00" />
<meta property="article:modified_time" content="2013-10-14T18:50:32+00:00" />
<meta property="fb:app_id" content="31415926_facebook_app_id" />
<meta property="og:image" content="http://someimage.png" />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:site" content="@viktorminator"/>
<meta name="twitter:domain" content="Web Tutorials"/>
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
git clone git://github.com/creationix/nvm.git ~/.nvm
printf "\n\n# NVM\nif [ -s ~/.nvm/nvm.sh ]; then\n\tNVM_DIR=~/.nvm\n\tsource ~/.nvm/nvm.sh\nfi" >> ~/.bashrc
NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
<?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;
$(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');
@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;
}
@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')
}