Skip to content

Instantly share code, notes, and snippets.

View loperd's full-sized avatar
🌴

Roman loperd

🌴
View GitHub Profile
const NODE_ENV = process.env.NODE_ENV
const ExtractCssChunks = require("extract-css-chunks-webpack-plugin")
const webpack = require('webpack')
const path = require('path')
module.exports = {
mode: NODE_ENV,
entry: { app: path.resolve(__dirname, 'src/js/index') },
@loperd
loperd / alghoritm_for_read_last_N_words.php
Last active August 31, 2018 16:11
Tail utilites in php.
<?php
// check count args
if ($_SERVER['argc'] < 2) {
print('Please specify file name'. PHP_EOL);
exit(2);
}
$file_name = $_SERVER['argv'][1];
$n = intval($_SERVER['argv'][2] ?? 10);
@loperd
loperd / authme_genpass.php
Last active January 10, 2020 09:33
Function for generation password as authme in php!
<?php
declare(strict_types=1);
function generateSalt(int $length = 20): string
{
$chars = 'abdefhiknrstyzABDEFGHKNQRSTYZ23456789';
$numChars = strlen($chars);
$result = '';
@loperd
loperd / Dockerfile
Created September 23, 2018 13:19
Dockerfile php
FROM php:7.2-alpine
RUN apk update && apk add curl && \
apk add --no-cache icu-dev \
zlib-dev \
g++
RUN apk add --no-cache \
expat \
libcurl \
musl \
@loperd
loperd / index.js
Created October 5, 2018 11:33 — forked from tuwukee/index.js
// todos-vue/src/backend/axios/index.js
import axios from 'axios'
const API_URL = 'http://localhost:3000'
const securedAxiosInstance = axios.create({
baseURL: API_URL,
withCredentials: true,
headers: {
body {
background-color: #212121 !important;
background-clip: border-box !important;
background-origin: padding-box !important;
background-attachment: scroll !important;
background-repeat: repeat !important;
background-size: auto !important;
background-position: left top !important
}
pre,
@loperd
loperd / parse_dotenv.bash
Created August 4, 2019 08:36 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
<?php
declare(strict_types=1);
$files = [
'../path/to/file1.txt',
'../path/to/file2.txt',
'../path/to/file3.txt',
'../path/to/file4.txt',
];
MODE=""
TYPE=""
POSITIONAL=()
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-m | --mode)
MODE="$2"
@loperd
loperd / tmux-cheatsheet.markdown
Created January 29, 2020 10:09 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname