Skip to content

Instantly share code, notes, and snippets.

View p8R's full-sized avatar
🏠
Working from home

p8R

🏠
Working from home
View GitHub Profile
@p8R
p8R / text_colors.js
Created October 19, 2023 07:03
JavaScript Code for handling colors in texts printed on console. Using ANSI color codes.
const ESC = '\x1B';
const RESET = ESC + '[0m';
const BOLD = ESC + '[1m';
const BOLDRESET = ESC + '[22m';
const CLRSCR = ESC + '[2J';
const CUR00 = ESC + '[H'
const CLS = CLRSCR + CUR00;
const fgCIdx = idx => ESC + `[38;5;${idx}m`;
@p8R
p8R / docker-compose.yml
Created May 23, 2020 10:47 — forked from ju2wheels/docker-compose.yml
docker-compose reference YAML file with comments
# https://docs.docker.com/compose/yml/
# Each service defined in docker-compose.yml must specify exactly one of
# image or build. Other keys are optional, and are analogous to their
# docker run command-line counterparts.
#
# As with docker run, options specified in the Dockerfile (e.g., CMD,
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to
# specify them again in docker-compose.yml.
#
service_name:
@p8R
p8R / Dockerfile
Created May 7, 2020 16:24 — forked from michaelneu/Dockerfile
docker-compose configuration for PHP with NGINX and MySQL, including sendmail, MailDev and phpmyadmin
# see https://github.com/cmaessen/docker-php-sendmail for more information
FROM php:5-fpm
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysql mysqli sysvsem
RUN pecl install xdebug-2.5.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@p8R
p8R / Dockerfile
Created May 5, 2020 09:05 — forked from jcavat/Dockerfile
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
@p8R
p8R / Dockerfile
Created May 5, 2020 09:05 — forked from jcavat/Dockerfile
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
<VirtualHost *:80>
ServerAdmin $EMAIL
DocumentRoot $DOCROOT
ServerName $SERVER_NAME
ServerAlias $SERVER_ALIAS
#ErrorLog "logs/dummy-host.example.com-error.log"
#CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
@p8R
p8R / gist:d67caaceca23692500ccc2c0763dc694
Created August 16, 2018 12:20 — forked from faisalarbain/gist:9340940
Snippet to setup apache and VHOST for Vagrant Provisioner
# Apache
# ------
# Install
apt-get install -y apache2
# Remove /var/www default
rm -rf /var/www
# Symlink /vagrant to /var/www
@p8R
p8R / Install-php7.md
Created July 3, 2018 08:38 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@p8R
p8R / gist:b988570683882f0fafb0a2d352412339
Created May 9, 2018 11:16
SublimeText 3 Java build system 2 variants: build (Ctrl+B), run (Ctrl+Shift+B)
{
"cmd": ["javac", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java",
"shell": true,
"encoding": "cp1250",
"variants": [
{ "cmd": ["java", "$file_base_name"],
"name": "Run Java"
@p8R
p8R / Default.sublime-theme
Created December 12, 2017 13:28
Default Sublime Text theme with styles for modified files tabs
[
{
"class": "sidebar_label",
"color": [50, 50, 50],
"font.bold": false,
"font.size": 15,
"shadow_color": [190, 190, 190],
"shadow_offset": [1, 1],
},
{