Skip to content

Instantly share code, notes, and snippets.

@tttptd
tttptd / SSL-certs-OSX.md
Created December 11, 2019 17:03 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@tttptd
tttptd / default
Created December 11, 2019 09:49 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@tttptd
tttptd / Instructions.md
Created May 30, 2019 06:28 — forked from pgilad/Instructions.md
Generate SSL Certificate for use with Webpack Dev Server (OSX)

Generate private key

$ openssl genrsa -out private.key 4096

Generate a Certificate Signing Request

openssl req -new -sha256 \
@tttptd
tttptd / EventBus.js
Last active March 9, 2019 07:16
Simple Pub/Sub class
export class EventBus {
/**
* @private
* @returns {{}}
*/
static _allListeners() {
const self = EventBus;
if(self.__listeners === undefined) {
self.__listeners = {};
@tttptd
tttptd / Laravel-Container.md
Created December 14, 2017 10:48
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

Accessing the Container

@tttptd
tttptd / download-video
Last active May 7, 2017 16:04
Trim video file with ffmpeg
#!/bin/bash
youtube-dl --verbose --yes-playlist --format 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' $1
@tttptd
tttptd / Contracts Costable.php
Last active December 21, 2016 16:21
Doctrine 2 Inheritance Mapping
<?php
namespace Domain\Contracts\Entities\Product;
use Money\Money as MoneyValue;
use Domain\Entities\Money\Money as MoneyEntity;
/**
* Имеет стоимость
*/
@tttptd
tttptd / tmux.md
Created September 27, 2016 13:35 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@tttptd
tttptd / README.md
Created September 27, 2016 13:31 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@tttptd
tttptd / docker-compose.yml
Created September 16, 2016 17:58 — forked from niklv/docker-compose.yml
docker redmine postgresql
services:
web:
image: 'redmine:passenger'
container_name: 'redmine_web'
restart: always
ports:
- '3000:3000'
links:
- postgres
environment: