Skip to content

Instantly share code, notes, and snippets.

@TinyPoro
TinyPoro / docker-for-mac.md
Created May 6, 2024 07:28 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@TinyPoro
TinyPoro / m3u8-to-youtube-live.md
Created February 11, 2021 03:56 — forked from qntmpkts/m3u8-to-youtube-live.md
Restream m3u8 stream with ffmpeg to youtube live

Setup YouTube Live Event

Head on over to your YouTube live Events page (https://www.youtube.com/my_live_events).

Create a new live event that is unlisted (or private) and of Custom type.

Under Basic ingestion choose 1500 Kbps - 4000 kbps (720p).

Check the Enable 60fps box.

<?php
declare(strict_types = 1);
namespace App\Kafka;
use RdKafka;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@TinyPoro
TinyPoro / system_usage_log.sh
Created June 17, 2020 07:08 — forked from vuthaihoc/system_usage_log.sh
System usage bash
#!/bin/bash
## Use : ss command
## variable for change :
##
##----------
Timetemp='%H%M'
Time=$(date +"${Timetemp}")
Date=$(date +"%y%m%d")
Yest=$(date --date="1 day ago" +"%y%m%d")
#Day=$(date +"%a")
ffmpeg -i data/video.mp4 -vcodec h264 -b:v 1000k -acodec mp2 data/output.mp4

Những sai lầm phát triển cơ sở dữ liệu phổ biến được bởi các nhà phát triển ứng dụng là gì?

nguồn https://stackoverflow.com/questions/621884/database-development-mistakes-made-by-application-developers

1. Không sử dụng các chỉ số thích hợp

Đây là một điều khá đơn giản, nhưng nó vẫn xảy ra thường xuyên. Khoá ngoại nên có các chỉ mục cho chúng. Nếu bạn đang sử dụng một trường trong nơi mà bạn nên (có thể) có một chỉ mục trên nó. Các chỉ mục như vậy thường nên bao gồm nhiều cột dựa trên các truy vấn bạn cần thực hiện. 2. Không tuân theo sự toàn vẹn tham chiếu

Cơ sở dữ liệu của bạn có thể thay đổi nhưng nếu cơ sở dữ liệu của bạn c tính toàn vẹn tham chiếu -- có nghĩa là tất cả các khoá ngoại được đảm bảo để trỏ đến một thực thể tồn tại -- bạn nên sử dụng nó.

Source

Reasons for using design patterns

Introduction

Following on from a previous article entitled [Why design is Critical to Software Development][1], I would like to tackle a slightly more advanced aspect of software design called Design Patterns. As with my previous article, the idea came about during a discussion concerning the merits of software design with a work colleague. The protagonist of the discussion was of the opinion that Design Patterns are too time consuming to be of use within the field of commercial software development. My intention here is to demonstrate why I believe that to be wrong.

I will not go into any details about the mechanics or implementation of any particular Design Patterns. There are many excellent sources for these available elsewhere.

Source

Reasons for using design patterns

Introduction

Following on from a previous article entitled [Why design is Critical to Software Development][1], I would like to tackle a slightly more advanced aspect of software design called Design Patterns. As with my previous article, the idea came about during a discussion concerning the merits of software design with a work colleague. The protagonist of the discussion was of the opinion that Design Patterns are too time consuming to be of use within the field of commercial software development. My intention here is to demonstrate why I believe that to be wrong.

I will not go into any details about the mechanics or implementation of any particular Design Patterns. There are many excellent sources for these available elsewhere.