Skip to content

Instantly share code, notes, and snippets.

@yaredc
yaredc / meta-tags.md
Created July 13, 2017 10:10 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
#!/bin/sh
TARGET='/etc/hosts'
SOURCE="$HOME/hosts"
BACKUP="$HOME/hosts.$(date +'%Y-%m-%d').bak"
#BACKUP
cp "$TARGET" "$BACKUP"
#DOWNLOAD NEW
@yaredc
yaredc / no-warnings-and-notices.php
Last active September 9, 2019 21:22
Fix all PHP notices and warnings with this one simple trick!
<?php
declare(strict_types=1);
/*
* Convert all notices and warnings to errors.
* There is no point in warnings and notices.
*/
set_error_handler(static function ($errno, $errstr, $errfile, $errline): bool {
switch ($errno) {
@yaredc
yaredc / provision-ubuntu-19-04.sh
Last active September 9, 2019 21:19
Provisioning shell script for Ubuntu 19.04
#!/bin/sh
sudo apt install -y tmux screen git mc vim docker docker-compose keepassx yubikey-manager \
htop vlc nvidia-settings chromium-browser firefox gimp inkscape audacity unity-tweak-tool \
unity-control-center ubuntu-drivers-common &&\
sudo apt update -y &&
sudo apt upgrade -y &&
sudo apt autoremove -y &&
sudo usermod -a -G docker $(whoami)
@yaredc
yaredc / provision-debian-10-01.sh
Last active September 9, 2019 21:19
Provisioning shell script for Debian 10.1
#!/bin/sh
sudo apt install -y tmux screen git mc vim docker docker-compose keepassx yubikey-manager \
htop vlc nvidia-detect chromium chromium-l10n gimp inkscape audacity &&
sudo apt update -y &&
sudo apt upgrade -y &&
sudo apt autoremove -y &&
sudo usermod -a -G docker $(whoami)
#CHECK WHICH DRIVERS ARE RECOMMENDED
@yaredc
yaredc / delete-git-history.md
Created September 8, 2019 11:51
Delete/reset history in GIT repository.

RESET (EFFECTIVELY DELETE) TARGETED BRANCH HISTORY

  1. Checkout tmp branch without history, from whatever targeted commit or branch you want
  2. Delete targeted branch
  3. Rename tmp branch to targeted branch
  4. Force push to repo

IN CASE OF master BRANCH

.PHONY:up down build install uninstall clean dist
SHELL:=/bin/sh
ENV?=dev
TIMESTAMP:=$(shell date +"%Y.%m.%d.%H.%M.%S")
DIR_DIST:=$(shell pwd)/dist
TAR_DIST:=$(shell pwd)/dist.$(ENV).$(shell date +%s).tar.gz
DIR_ROOT:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
DIR_MAKE:=$(shell mkdir -p $(shell pwd)/.make)
RUNNING_CONTAINERS_IDS:=$(shell docker-compose ps -q)
BUILD_PRE:=docker-compose.yaml $(shell ls -d .docker/dev/*)
FROM php:7.3-fpm-alpine
#PROD
ENV ENVIRONMENT="production" \
DOCROOT="/var/www/html"
RUN apk add --no-cache --virtual .deps autoconf tzdata build-base libzip-dev postgresql-dev \
libxml2-dev libxslt-dev libpng-dev zlib-dev freetype-dev jpeg-dev icu-dev &&\
docker-php-ext-install zip xml xsl pgsql mbstring json intl gd pdo pdo_pgsql iconv &&\
echo 'date.timezone="Europe/Berlin"' >> "${PHP_INI_DIR}"/php.ini &&\
@yaredc
yaredc / run.sh
Last active October 14, 2019 19:28
#!/bin/sh
set -e
###########################################################
#DEFINE ALL GLOBAL INDEPENDENT HELPER FUNCTIONS
###########################################################
l() {
LEVEL="INFO"
FROM node:12.11.1-alpine
ENV ENVIRONMENT="production" \
DOCROOT="/var/www/html"
LABEL maintainer="[email protected]" \
product="app.node"
RUN apk add --no-cache --virtual .deps g++ gcc libgcc libstdc++ linux-headers make python &&\
npm install -g node-gyp less sass &&\