Skip to content

Instantly share code, notes, and snippets.

View Deifinger's full-sized avatar

Ruslan Kostikov Deifinger

View GitHub Profile
@Deifinger
Deifinger / .csscomb.json
Last active February 6, 2017 15:12
base project config
{
"always-semicolon": true,
"color-case": "lower",
"block-indent": "\t",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": false,
"quotes": "double",
"sort-order-fallback": "abc",
@Deifinger
Deifinger / functions.scss
Last active March 19, 2017 15:15
scss functions
/*
* Makes list of transitions in one property
*
* Example:
* transition: transitions((0: color, 1: opacity )); // returns transition:color .3s ease-in 0,opacity .3s ease-in 0
*/
@function transitions($properties: (0: all), $durations: (0: .3s), $timing-functions: (0: ease-in), $delays: (0: 0s)) {
$props: ((
'def': .3s,
'list': $durations
@Deifinger
Deifinger / WordPress Development .gitignore
Last active April 24, 2017 21:13 — forked from ixrevo/WordPress Development .gitignore
.gitignore file for setting up the WordPress development environment.
########################
# Wordpress Core files #
########################
wp-admin/
wp-content/backups/
wp-content/blogs.dir/
wp-content/languages/
wp-content/index.php
wp-content/themes/index.php
wp-includes/
# ######################################################################
# # MEDIA TYPES AND CHARACTER ENCODINGS #
# ######################################################################
# ----------------------------------------------------------------------
# | Media types |
# ----------------------------------------------------------------------
# Serve resources with the proper media types (f.k.a. MIME types).
#
@Deifinger
Deifinger / composer.json
Last active May 30, 2017 23:49
First Telegram bot
{
"require": {
"telegram-bot/api": "^2.2"
}
}
@Deifinger
Deifinger / .bash_profile
Created May 15, 2018 20:52
n - node js version manager - modifications for getting installed node js versions globally
# Changed PATH order, with §HOME/bin at the beginning, ahead of /usr/local/bin/
PATH=$HOME/.local/bin:$HOME/bin:$PATH
export PATH
# Add n prefix
export N_PREFIX=$HOME
@Deifinger
Deifinger / index.js
Last active June 21, 2018 14:16
Dijkstra's algorithm on JavaScript (es6)
const start = 'ml'
const graph = {
ml: {
zp: 30,
dp: 120,
},
zp: {
kv: 300,
dp: 70,
@Deifinger
Deifinger / manager.sh
Created January 7, 2019 20:25
Project shell helper
#!/usr/bin/env bash
# Written with best practices:
# - https://www.davidpashley.com/articles/writing-robust-shell-scripts/
# - https://github.com/progrium/bashstyle
[[ "$TRACE" ]] && set -o xtrace # For debugging. Print command traces before executing command.
set -o errexit # Tells bash that it should exit the script if any statement returns a non-true return value
set -o nounset # Exit script if you try to use an uninitialised variable
set -o pipefail # false | true will be considered to have fail
@Deifinger
Deifinger / index.php
Last active March 11, 2019 20:43
Дана строка 1 и символы A-Z и AA-ZZ, нам известно что A = 1, Z = 26, AA=27, ZZ =702 и т.д А вторая строка такая же но начинается с A=703. НУжно при вводе цифры вывести строку и символы для данной циры..
<?php
//Задача:
//- Дана строка 1 и символы A-Z и AA-ZZ, нам известно что A = 1, Z = 26, AA=27, ZZ =702 и т.д
//А вторая строка такая же но начинается с A=703. НУжно при вводе цифры вывести строку и символы для данной циры..
function generate_row($prev_c = '', $nested = 0, $iter_nest = 1, $deep = 2)
{
$str = '';
++$nested;
for ($c = 65; $c < 91; $c++) {
@Deifinger
Deifinger / Container.php
Created July 25, 2019 10:27 — forked from MustafaMagdi/Container.php
PHP Dependency Injection Container
<?php
/**
* Class Container
*/
class Container
{
/**
* @var array
*/