Skip to content

Instantly share code, notes, and snippets.

View Deifinger's full-sized avatar

Ruslan Kostikov Deifinger

View GitHub Profile
@mariocesar
mariocesar / api.js
Created September 26, 2017 04:21
Axios single configured instance
import axios from "axios";
const singleton = Symbol();
const singletonEnforcer = Symbol();
function readCookie(name) {
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
}
@actionm
actionm / deploy.sh
Created February 28, 2017 19:01
Zero downtime deployment script
# Deployment with zero downtime
# By default keeps 2 last deployments in KEEP_DEPLOYMENTS_DIR and current deployment
# Project domain
PROJECT_NAME=test.com
# Project directory
PROJECT_DIR=/home/forge/test.com
# Deployments directory
KEEP_DEPLOYMENTS_DIR=/home/forge/deploy
@sdieunidou
sdieunidou / .scrutinizer.yml
Created February 13, 2017 11:42
scrutinizer default configuration symfony3
filter:
excluded_paths:
- 'app/*'
- 'tests/*'
- 'bin/*'
- '*.min.js'
- 'web/assets/vendor/*'
- 'var/'
checks:
@JonCole
JonCole / WhatHappenedToMyDataInRedis.md
Last active October 28, 2019 19:43
What happened to my data in Redis?
@ierhyna
ierhyna / gulpfile.js
Last active June 12, 2021 15:12
gulpfile.js
'use strict';
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const browserSync = require('browser-sync');
const reload = browserSync.reload;
gulp.task('build:css', ['lint:css'], function () {
const postcss = require('gulp-postcss');
const nano = require('gulp-cssnano');
@ierhyna
ierhyna / wp-generated-css.css
Last active February 3, 2017 15:45
WordPress Generated CSS
/*
* Default Body Class Styles
* Generated by body_class()
*/
.rtl {}
.home {}
.blog {}
.archive {}
.date {}
@BR0kEN-
BR0kEN- / string_functions.sh
Created June 8, 2015 11:25
Bash implementation of strpos and substr functions from PHP library
#!/usr/bin/env bash
# @param string $1
# Input string.
# @param int $2
# Cut an amount of characters from left side of string.
# @param int [$3]
# Leave an amount of characters in the truncated string.
substr()
{