Skip to content

Instantly share code, notes, and snippets.

View IgorPropisnov's full-sized avatar

Igor Propisnov IgorPropisnov

View GitHub Profile
@IgorPropisnov
IgorPropisnov / spread-rest-destructing-template-literals.js
Last active September 24, 2018 10:26
[JavaScript ES6] Rest & Spread Operator, Destructing and Template Literals #javascript #es6
// Spread - Operator
const numbers = [1,1,2,3,5,8,13];
const maxFromArray = Math.max(...numbers); // returns 13
const num1 = [1,2,3];
const num2 = [4,5,6];
// this is also possible with objects
const fullnum = [...num1, ...num2]; // returns [1,2,3,4,5,6]
@IgorPropisnov
IgorPropisnov / arrow-function.js
Last active September 24, 2018 10:05
[JavaScript ES6] Arrow Function, Variations and Default value #javascript #es6
// old way
const addNumber = function(num1, num2) {
return num1 + num2
}
// this is same as..
const multiply = (num1, num2) => {
return num1 * num2;
}
// this, and...
@IgorPropisnov
IgorPropisnov / package.json
Created March 17, 2018 14:33
[Asp env mode] Run ASP.NET in development mode #asp #npm
{
"scripts": {
"start": "ASPNETCORE_ENVIRONMENT=Development dotnet run",
"watch": "ASPNETCORE_ENVIRONMENT=Development dotnet watch"
}
}
@IgorPropisnov
IgorPropisnov / pagination.html5
Last active November 29, 2017 14:08
[Contao Pagination] Next and Prev Tags for Pagination #seo #contao
<?php
if($this->hasPrevious == 1) {
$previousHref = $this->previous["href"];
$GLOBALS['TL_HEAD'][] = '<meta name="robots" content="noindex,follow">';
$GLOBALS['TL_HEAD'][] = '<link rel="prev" href="'.$previousHref.'">';
} else {
$GLOBALS['TL_HEAD'][] = '<meta name="robots" content="index,follow">';
}
if($this->hasNext == 1) {
$nextHref = $this->next["href"];
@IgorPropisnov
IgorPropisnov / config.rb
Created September 12, 2017 09:11
[Config File SCSS] Config file for scss #scss #css #config
# Require any additional compass plugins here.
Encoding.default_external = 'utf-8'
project_type = :stand_alone
asset_cache_buster :none
sass_dir = "./scss/"
css_dir = "./files/"
# images_dir = "../img"
# fonts_dir = "../fonts"
@IgorPropisnov
IgorPropisnov / patter.js
Created August 24, 2017 19:26
[jQuery Pattern] Pattern for jQuery #jquery #javascript #pattern
"use strict";
(function($) {
/*
* Comment
*/
function foo() {
// Do crazy shit here...
}
@IgorPropisnov
IgorPropisnov / index.html
Last active August 24, 2017 19:21
[HTML embedded PHP] Embedded PHP inside html tag #php #html
<?php if($condition) : ?>
<a href="http://yahoo.com">This will only display if $condition is true</a>
<?php elseif($anotherCondition) : ?>
more html
<?php else : ?>
even more html
<?php endif; ?>
@IgorPropisnov
IgorPropisnov / tl_page.php
Last active August 24, 2017 19:21
[Custom Palettes] Added custom palettes to contao tl_page #contao #tl_page #module #dca
// iterate trought contaos tl_page palettes and added custom field between something you want
$GLOBALS['TL_DCA']['tl_page']['palettes']['regular'] = str_replace
(
'description',
'custom_field_1, custom_field_2, description',
$GLOBALS['TL_DCA']['tl_page']['palettes']['regular']
);