Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View colorwebdesigner's full-sized avatar

Ivan Pro colorwebdesigner

View GitHub Profile
@colorwebdesigner
colorwebdesigner / deb.js
Last active November 16, 2018 03:03
JS debug helper
/**
* [deb] Debugging function
* Pass any kind of variables and
* see the result
*
* @return {[false]} [always]
*/
function deb() {
let msg = '';
if(arguments.length == 0) msg += '(!) debug: don\'t spend my time.\n';
@colorwebdesigner
colorwebdesigner / isEmptyObj.js
Created November 16, 2018 10:05
Check JS object is emty or not
/**
* [isEmtyObj]
*
* @param {[object]} obj [description]
* @return {[boolean]} [description]
*/
function isEmptyObj(obj) {
// console.log('Obj cont: ' + obj);
// console.log(`Obj leng: ${obj.length}`);
@colorwebdesigner
colorwebdesigner / gulp-responsive.json
Last active April 25, 2019 00:34
#gulp #gulp-responsive
"responsive": {
"config": {
"bg/bg-*.jpg": [{
"width": 1600,
"quality": 70,
"rename": { "suffix": "-1600x" },
"skipOnEnlargement": true
}, {
"width": 800,
"quality": 70,
@colorwebdesigner
colorwebdesigner / buildFontList.js
Last active April 29, 2019 01:37
build fonts.list for gulp-google-webfonts
"use strict";
// Gulp API and configuration
const { src, dest } = require('gulp');
// Other dependencies
const googleFonts = require('gulp-google-webfonts');
const getUrls = require('get-urls');
const through2 = require('through2');
const url = require('url');
@colorwebdesigner
colorwebdesigner / informer.jquery.js
Created April 30, 2019 11:52
Lightweight message system for jquery
'use strict';
/**
* Informer
* Lightweight message system
*
* @options
*
* type -
* life -
* speed -
@colorwebdesigner
colorwebdesigner / svgConnect.jquery.js
Created April 30, 2019 12:36
Connect objects with svg line
'use strict';
/**
* svgConnect
* Connect objects with svg line
*
* @options
*
*/
(function($) {
@colorwebdesigner
colorwebdesigner / reset.css
Last active May 18, 2019 16:57
Combination of normalize.css v8.0.1 + reset.css
/*!
--------------------------------
normalize.css v8.0.1 + reset.css
--------------------------------
*/
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
}
body, html {
@colorwebdesigner
colorwebdesigner / catch-arguments.sh
Last active July 26, 2019 03:10
Catch and processing script arguments
# Function to print help message and exit
usage () {
[ ! -z "$1" ] && printf "\n \e[31m[ error ]\e[0m $0: %s\n" "$1" >&2
printf "$USAGE" >&2
exit 2
}
# Catch arguments
for (( i=1; i<=$#; i++ )); do
case "${!i}" in
@colorwebdesigner
colorwebdesigner / slackIPChangeInfo.rsc
Last active May 23, 2020 10:36
Mikrotik script for send message to Slack on IP change
:global ipCurrent "$ipCurrent";
{
# Change to your settings
# -----------------------
:local wanInterface "eth1";
:local slackHookUrl "https://hooks.slack.com/services/YOUR/APP/SECRET";
# -----------------------
:local ipNew [/ip address get [find interface=$wanInterface] address];