Skip to content

Instantly share code, notes, and snippets.

Viktor Bogutskii bogutski

Block or report user

Report or block bogutski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:62180e47e4f39006a1cbc97fb9a95b23
=== Сравнение массивов ==============================================================
let mas1 = ["some1", "some2", "some3", "some4"],
mas2 = ["some1", "some5", "some3"];
Array.prototype.diff = Array.prototype.diff || function(a2) {
return this.filter(i => a2.indexOf(i) < 0);
};
console.log(mas1.diff(mas2));
View gulpfile.js
'use strict';
// including plugins
var gulp = require('gulp'),
concat = require("gulp-concat"),
minifyCss = require("gulp-minify-css"),
uglify = require("gulp-uglify"),
watch = require('gulp-watch'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer');
@bogutski
bogutski / autoform.js
Created Nov 20, 2016
Meteor.js Autoform
View autoform.js
// Example object
Cars = new Mongo.Collection('cars');
Cars.attachSchema(new SimpleSchema({
make: {
type: String,
label: "Make",
max: 20,
},
model: {
@bogutski
bogutski / Phalcon_and_Handlebars.volt
Last active Sep 6, 2016
Example. Handlebars template in Volt template in Phalcon
View Phalcon_and_Handlebars.volt
Use this construction
{{ "
... Handlebars here ...
" }}
<script id="saleTemplate" type="text/x-handlebars-template">
@bogutski
bogutski / MySQL local dump and import to remote by SSH
Created Aug 24, 2016
Bash script for import from local MySQL database to remote DB through SSH
View MySQL local dump and import to remote by SSH
lclDBName="value"
lclDBUser="value"
lclDBPass="value"
RemoteDBName="value"
RemoteDBUser="value"
RemoteDBPass="value"
RemoteHost="localhost"
lclHost="localhost"
View phalcon-ru-image.php
<div style="text-align: center">
<?php
// 45934290 - ID группы
$d = file_get_contents("https://api.vk.com/method/groups.getMembers?group_id=45934290&v=5.16&offset=0&count=1000&fields=photo_50");
$us= json_decode($d,true);
foreach($us['response']['items'] as $u){
echo sprintf('<img src="%s"/>',$u['photo_50']);
@bogutski
bogutski / custom.js
Last active Sep 17, 2016
Template for custom JS file for Drupal
View custom.js
jQuery.noConflict();
(function ($) {
$(document).ready(function () {
// Code here
});
})(jQuery);
@bogutski
bogutski / microrules.scss
Last active Jun 26, 2016
CSS classes for fast correction
View microrules.scss
.fll, .fl { float: left; }
.flr, .fr { float: right; }
.mr0 { margin-right: 0px; }
.mr5 { margin-right: 5px; }
.mr10 { margin-right: 10px; }
.mr15 { margin-right: 15px; }
.mr20 { margin-right: 20px; }
.mr25 { margin-right: 25px; }
.mr30 { margin-right: 30px; }
View JS. Count children in LI elements.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<ul>
You can’t perform that action at this time.